node-RED Backup Flow

Since node-RED v1.2.0, the config.json file has been split up into seperate files, so to capture those files for the backup, please change this line in the node-red-contrib-dsm node;

"cmd += pre + '.config.json';",

to

"cmd += pre + '.config*.json';",

...which includes the wildcard character * to ensure that all of the conf files are included.

3 Likes

Flow updated (see post #1 above) to include the additional package.json & package-lock.json'contained within the externalModules folder, which was introduced in v1.3.0.

The changes in the DSM node are the inclusion of;

"cmd += pre + 'externalModules/package.json';",
"cmd += pre + 'externalModules/package-lock.json';",

Flow updated (see post #1 above) to accommodate changes made in node-RED v2.0.0.
The package.json & package-lock.json' contained within the externalModules folder, which was introduced in node-RED v1.3.0 has now been discontinued, and a .config.modules.json file added to manage the external modules instead.

The changes in the DSM node therefore are the removal of lines;

"cmd += pre + 'externalModules/package.json';",
"cmd += pre + 'externalModules/package-lock.json';",

and the addition of;

"cmd += pre + '.config.modules.json';",
1 Like

Paul, I'm using projects, are you covering all files required also in this case?

Hi Walter, I haven't added projects, but it shouldn't be too difficult to add.
I don't use projects, but I'm assuming that the default node-RED structure would be;

.node-red
         |__ projects
                     |__ my_first_project
                     |__ my_second_project

...and the projects subfolders will include the respective project's flow files, etc.

Is that correct?

If so, you would need to add this at line 52 in the dsm node

"cmd += pre + 'projects/*';",

so it looks like this

projects

Adding that line will add all sub-folders & files within the projects folder to the zip backup file.

Hope that helps!

Excellent, thank you!!

1 Like

If you are using projects then you can link the project to, for example, a github repository so you won't need to back it up to usb.

I think it would be worth having this as an FAQ/Sticky for all the newbies.

There has to be at least one a month on here asking about corrupted flows, SD cards etc etc

Craig

1 Like