# Backup and Restore

**URL:** <https://discourse.nodered.org/t/backup-and-restore/61632>\
**Category:** General\
**Created:** [22 April 2022 08:50 UTC](https://discourse.nodered.org/t/backup-and-restore/61632 "2022-04-22T08:50:03Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![agmacedo](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/agmacedo/32/31119_2.png) [@agmacedo](https://discourse.nodered.org/u/agmacedo)\
**Post date:** [22 April 2022 08:50 UTC](https://discourse.nodered.org/t/backup-and-restore/61632/1 "2022-04-22T08:50:03Z")

</div>

I have a node-red application that has been growing for some time.  
It works on windows 10 and controls several PLCs on a industrial envinorment.  
I make daily backups of the all application (example: c:\hmi\_1880), but when I test the same application on another pc, simple just by copying the folder and install node.js and npm I face many complications. What is the best and reliable way (if exists) to make the backups and restore without copy all the flows, one by one.

Thanks,

---

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [22 April 2022 09:00 UTC](https://discourse.nodered.org/t/backup-and-restore/61632/2 "2022-04-22T09:00:44Z")

</div>

I'm not familiar with the windows structure, but......

Copy all the `.j*` files to another directory.

I think it is basically - given you are in the `node-red` directory:

```auto
copy *.j* c:\somewhere_else

```

If you get what I mean with the `c:\somewhere_else`

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [22 April 2022 11:55 UTC](https://discourse.nodered.org/t/backup-and-restore/61632/3 "2022-04-22T11:55:52Z")

</div>

> [@agmacedo](#):
>
> I face many complications

Can you explain what the complications are? Usually, as long as you copy the whole userDir folder (minus the `node_modules` folder) and do an npm install in the userDir folder on the target, everything should work other than if you have some hardware configuration that is different (e.g. serial ports) or have hard-coded something into your flows that only works on the source (e.g. some kind of IP address maybe).

---

<div class="post-metadata">

**Author:** ![agmacedo](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/agmacedo/32/31119_2.png) [@agmacedo](https://discourse.nodered.org/u/agmacedo)\
**Post date:** [23 April 2022 08:43 UTC](https://discourse.nodered.org/t/backup-and-restore/61632/4 "2022-04-23T08:43:37Z")

</div>

Thanks for the answers.

I also thought it was as simple as just copying files between directories, and then install node js and node-red.  
I tried several times and the problem persist. Does not have nothing to do with drivers or ip address. I think the problem is in the node-red.

1. Node-red versiona: v2.1.1 and v2.2.2.
2. Node js versions: 12.19.0 and 16.14.2
3. The dark theme desapears (strange and don´t accept it anymore)
4. Some of the ui\_text, ui\_charts (dashboards elements) disappeared, no matter what I try?

Conclusion, just part of the app works on the new pc. Unless something is missing it´s not a linear process.

Question: Is all configurations files in the app folder? How can I access json files direct?  
Is there a way to clean all the files related to node-red previous instalations?

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [23 April 2022 08:57 UTC](https://discourse.nodered.org/t/backup-and-restore/61632/5 "2022-04-23T08:57:21Z")

</div>

When moving your installation from one system to another, these are the steps i would recommend...

OLD MACHINE

1. Backup everything in `.node-red` except `node_modules` folder

NEW MACHINE

1. Install git, nodejs & node-red
2. Run node-red & make sure it works as expected
3. stop node-red
4. Copy the files backed up from OLD to NEW
5. run `npm i` inside the `.node-red` folder
6. Start node-red and test.

NOTE: If your flows are not loaded, it is probably due to the name of them. If they are named something like `OldDellPC.json` & `OldDellPC_creds.json` then rename them to `flows.json` and `flows_creds.json` then start node-red again.

---

<div class="post-metadata">

**Author:** ![agmacedo](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/agmacedo/32/31119_2.png) [@agmacedo](https://discourse.nodered.org/u/agmacedo)\
**Post date:** [23 April 2022 10:21 UTC](https://discourse.nodered.org/t/backup-and-restore/61632/6 "2022-04-23T10:21:07Z")

</div>

Thanks again.  
I forgot to say that my folder app is not _.node-red_ but something like _c:\hmi\_App_.  
If I´m right the ".node-red" folder is the default folder where node-red install the first app.  
So I just have to backup my "c:\hmi\_App", right ?

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [23 April 2022 10:23 UTC](https://discourse.nodered.org/t/backup-and-restore/61632/7 "2022-04-23T10:23:47Z")

</div>

> [@agmacedo](#):
>
> If I´m right the ".node-red" folder is the default folder where node-red install the first app.

when we say your `.node-red` folder, we mean the folder that was created the first time you ran node-red.

It can easily be determined by looking at the node-red startup log...

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/a/0/a03dcb25267cbb70d7c3a8d77222f07c0ef0feaf.png)

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [23 April 2022 11:51 UTC](https://discourse.nodered.org/t/backup-and-restore/61632/8 "2022-04-23T11:51:57Z")

</div>

> [@Steve-Mcl](#):
>
> when we say your `.node-red` folder, we mean the folder that was created the first time you ran node-red.

Referred to as the `userDir` folder since this is what it is called in the docs.

> [@agmacedo](#):
>
> - Node-red versiona: v2.1.1 and v2.2.2.
> - Node js versions: 12.19.0 and 16.14.2

Well that's just general stuff that you've installed that are different versions. Both should be fine. But if you want both machines to be the same, obviously, you have to keep the environment updated.

> [@agmacedo](#):
>
> The dark theme desapears (strange and don´t accept it anymore)

I so rarely do anything with the theme that I always forget. In settings.js the `editorTheme.page.css` specifies the location of the CSS for the theme. If it isn't working, the CSS file is probably specified using an absolute path and that is different on the other machine.

Where you are referencing paths and files, you do, of course, need to make sure that the references work on both machines.

> [@agmacedo](#):
>
> Some of the ui\_text, ui\_charts (dashboards elements) disappeared, no matter what I try?

We would have to see the specifics, I don't use Dashboard much so I'm not sure what is going on there.

> [@agmacedo](#):
>
> it´s not a linear process.

It is a "linear process" as I think you conceive of it. But you do have to understand the rules. This isn't specific to Node-RED of course.

> [@agmacedo](#):
>
> Is all configurations files in the app folder?

No, all of the configuration is in the `userDir` folder, `~/.node-red` by default. With the possible exceptions:

- Where you are running Node-RED automatically. There will be OS specific configuration.
- Where you are referencing hardware, there may again be OS specific configuration.

> [@agmacedo](#):
>
> How can I access json files direct?

Define "direct"? In Node-RED, the OS, ... ?

> [@agmacedo](#):
>
> Is there a way to clean all the files related to node-red previous instalations?

Of course, you can simply delete the userDir folder and everything is gone.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [22 June 2022 11:52 UTC](https://discourse.nodered.org/t/backup-and-restore/61632/9 "2022-06-22T11:52:40Z")

</div>

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
