node-RED Backup Flow

What is the consensus re .sessions.json, does it stay, or shall I remove it from the example flow config that I posted in post #1?

ie. Is it necessary for .sessions.json to form part of a node-RED backup archive.

No responses... so it has now been removed from the example flow above.

Missed your original question. The sessions file contains the active login tokens for the editor. No need to back it up.


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';",


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

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


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;

         |__ 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


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.

1 Like

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



This was very helpful. Thank you so much for this one.

1 Like

This one just saved me, but I had not saved my dropbox access token, and now dropbox only pass out short lived tokens. Is there a solution to this?

Use projects mode and sync to a github repo - never lose a thing.

Except then Microsoft have full access to all your code to include in their new AI system - which may or may not concern someone


Craig, so as precaution I assume you still use this model?



I have the same issue. Pretty much everyday I have to go get a new token and then do my "automatic" backup. :slight_smile:

The flow uses the 'dropbox' node to update the backup to Dropbox, so I would suggest raising the issue with the node maintainers, who may be able to fix, advise or update their node's readme to overcome the problem.

To clarify, the problem is not with this flow, it's because the Dropbox node has not been updated since dropbox's API auth was changed.

1 Like

18 posts were merged into an existing topic: Node-red-node-dropbox token expiration

Discussion about problems with node-red-node-dropbox moved to...