# Q about backing up workspace

**URL:** https://discourse.nodered.org/t/q-about-backing-up-workspace/35879
**Category:** General
**Created:** [13 November 2020 16:34 UTC](https://discourse.nodered.org/t/q-about-backing-up-workspace/35879 "2020-11-13T16:34:06Z")
**Posts on this page:** 12
**Page:** 1

<div class="post-metadata">

### Author: ![RASelkirk](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/raselkirk/32/57425_2.png) [@RASelkirk](https://discourse.nodered.org/u/RASelkirk)
#### Post date: [13 November 2020 16:34 UTC](https://discourse.nodered.org/t/q-about-backing-up-workspace/35879/1 "2020-11-13T16:34:07Z")

</div>

Hi All,

My project has grown to over 30 nodes, prolly still considered "small", but to me it represents a lot of work! I'd like to know the correct way to back up the entire project. I'm making some assumptions here:

Is it as simple as exporting the flow to a file?

Does "ctrl-a" get everything together enough to export?

I'm on a diff 'puter on my network, where does the file get saved?

Thanks!

Russ

---

<div class="post-metadata">

### Author: ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)
#### Post date: [13 November 2020 16:41 UTC](https://discourse.nodered.org/t/q-about-backing-up-workspace/35879/2 "2020-11-13T16:41:16Z")

</div>

If you have access the device running Node-RED, then a minimal backup would be to copy the files:

- `~/.node-red/package.json`
- your flow and credential files (check the Node-RED startup log to get the exact filename)
- your settings file: `~/.node-red/settings.js`

If you have not set the `credentialSecret` property in your settings file (there's a big message in the log on startup telling you to if you haven't), then you'll also need to copy the value of `_credentialSecret` out of `~/.config.runtime.json` (or `.config.json` if on Node-RED 1.1 or earlier).

For the majority of cases, that would get you everything you needed to restore your flows elsewhere.

If you don't have access to the device running Node-RED, then you will be able to export your flows as JSON from the editor, but it will _not_ include an credentials. You'll also have to take a manual record of the extra nodes you have installed.

---

<div class="post-metadata">

### Author: ![RASelkirk](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/raselkirk/32/57425_2.png) [@RASelkirk](https://discourse.nodered.org/u/RASelkirk)
#### Post date: [13 November 2020 16:53 UTC](https://discourse.nodered.org/t/q-about-backing-up-workspace/35879/3 "2020-11-13T16:53:35Z")

</div>

I am getting the credentials message as I've not done that. Is this considered important to do?

Right now, my flows are great. I'm afraid I'm so rookie I'll "trash the works" trying new stuff. Would like to be able to get back to a safe breakpoint on the same pi. So ctrl-a and export flow for that?

As far as making a backup restorable to a new or formatted pi, the steps you list will have all the current palette nodes and UI settings? Just replace said files with the backups once N-R has been reinstalled?

Would this feature be a worthwhile addition to a future N-R upgrade?

Thanks!

Russ

---

<div class="post-metadata">

### Author: ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)
#### Post date: [13 November 2020 17:10 UTC](https://discourse.nodered.org/t/q-about-backing-up-workspace/35879/4 "2020-11-13T17:10:41Z")

</div>

> [@RASelkirk](#):
>
> I am getting the credentials message as I've not done that. Is this considered important to do?

We wouldn't print out a large message in the log advising you to do it if we didn't think it was important.

If you don't set your own `credentialSecret` in your settings file, then you are using a randomly generated key. If anything happens to lose that generated key, you won't be able to decrypt your credentials file ever again and you'll have to re-enter any credential properties through-out your flow.

By setting your own key, you know what it is and will be able to restore things should something go awry.

In terms of restoring a system with those files, the basic process would be:

1. copy those files back in `~/.node-red` on the new device
2. run `npm install` in the `~/.node-red` directory in order to reinstall all of the extra nodes you had (they are all listed in the `package.json` file, which is why you backed that up)
3. run Node-RED.

You _may_ find you need to hardcode the flow file name in your settings file to ensure it picks up the right file.

---

<div class="post-metadata">

### Author: ![RASelkirk](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/raselkirk/32/57425_2.png) [@RASelkirk](https://discourse.nodered.org/u/RASelkirk)
#### Post date: [13 November 2020 19:32 UTC](https://discourse.nodered.org/t/q-about-backing-up-workspace/35879/5 "2020-11-13T19:32:12Z")

</div>

Upon reading thru my settings.js file, it appears the "credentialSecret" value can be set to false. Would this be OK for a solo'er like me who uses N-R on a the pi and writes to N-R from a Windows box on my home network? At 67, I'm trying to keep the complexity to a minimum...

Russ

---

<div class="post-metadata">

### Author: ![Paul-Reed](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/paul-reed/32/66906_2.png) [@Paul-Reed](https://discourse.nodered.org/u/Paul-Reed)
#### Post date: [13 November 2020 20:23 UTC](https://discourse.nodered.org/t/q-about-backing-up-workspace/35879/6 "2020-11-13T20:23:58Z")

</div>

It's your system and you can do whatever you want 😉

But the advice is to set a credential secret, because if you don't, your credentials will be encrypted using an auto generated key (and you won't know what it is!).  
Then if you try to restore node-RED from a backup, you will have problems de-crypting.

In the long run it will save you problems.

Even a simple plain password will do;  
`credentialSecret: "RASelkirk",`

---

<div class="post-metadata">

### Author: ![RASelkirk](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/raselkirk/32/57425_2.png) [@RASelkirk](https://discourse.nodered.org/u/RASelkirk)
#### Post date: [13 November 2020 20:44 UTC](https://discourse.nodered.org/t/q-about-backing-up-workspace/35879/7 "2020-11-13T20:44:57Z")

</div>

I'll put something in there. So, setting to "false" does nothing but turning off the nag message?

Thanks!

Russ

---

<div class="post-metadata">

### Author: ![Paul-Reed](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/paul-reed/32/66906_2.png) [@Paul-Reed](https://discourse.nodered.org/u/Paul-Reed)
#### Post date: [13 November 2020 20:50 UTC](https://discourse.nodered.org/t/q-about-backing-up-workspace/35879/8 "2020-11-13T20:50:29Z")

</div>

> [@RASelkirk](#):
>
> setting to "false" does nothing but turning off the nag message?

As I understand, setting to `false` stops the credentials being encrypted (and the nag messages), and therefore your credentials would be stored in plain text, which could potentially create a security risk.  
It's better/safer to have them encrypted.

Paul

---

<div class="post-metadata">

### Author: ![RASelkirk](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/raselkirk/32/57425_2.png) [@RASelkirk](https://discourse.nodered.org/u/RASelkirk)
#### Post date: [13 November 2020 21:54 UTC](https://discourse.nodered.org/t/q-about-backing-up-workspace/35879/9 "2020-11-13T21:54:53Z")

</div>

No, it's done. It's just so danged hard to find this stuff in the documentation section!

Here's another newbie Q: I've got N-R on my pi but am actively building on my Winbox. So far, I've "saved" a half-dozen nodes while on the Winbox, but when I try and import one, there are only two showing and both if those are on the pi. So, where are the files saved on the Winbox? I'm guessing I need to eventually transfer them to the pi, but gotta find them first...

Russ

---

<div class="post-metadata">

### Author: ![Paul-Reed](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/paul-reed/32/66906_2.png) [@Paul-Reed](https://discourse.nodered.org/u/Paul-Reed)
#### Post date: [13 November 2020 22:01 UTC](https://discourse.nodered.org/t/q-about-backing-up-workspace/35879/10 "2020-11-13T22:01:57Z")

</div>

If it's a different issue, it should be a new thread Russ.  
A lot of users just scan the thread titles, and therefore you stand a better chance of a reply.  
Also, it makes the information easier to find by other users in the future.

---

<div class="post-metadata">

### Author: ![RASelkirk](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/raselkirk/32/57425_2.png) [@RASelkirk](https://discourse.nodered.org/u/RASelkirk)
#### Post date: [13 November 2020 22:02 UTC](https://discourse.nodered.org/t/q-about-backing-up-workspace/35879/11 "2020-11-13T22:02:48Z")

</div>

Yup, thanks!

---

<div class="post-metadata">

### Author: ![Paul-Reed](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/paul-reed/32/66906_2.png) [@Paul-Reed](https://discourse.nodered.org/u/Paul-Reed)
#### Post date: [13 November 2020 22:04 UTC](https://discourse.nodered.org/t/q-about-backing-up-workspace/35879/12 "2020-11-13T22:04:56Z")

</div>


