Using projects as a back up?

May i ask if i transfer my flows to a project then commit the project from my linux server can i then pull back the flows onto my windows PC and run node-red with these flows or is it more complicated that that? and if i can is it possible to explain how this is done?
Appreciate any help you can give for this i am hoping to use this as a back up if the linux server dies.

Yes you can do that:
https://nodered.org/docs/user-guide/projects/

Thanks for replying @ghayne , I have read the project guide but am unsure of how i clone the project onto my windows PC from git? . The procedure i mean to do this? forgive my lack of knowledge but i am here to learn :wink:
Thanks again

Directly from Node red. When you create a new project you have the possibility to clone a GitHub repository.

ahh ty @ghayne

Please note that Projects don't back up everything needed, especially if you are using multiple projects. You should still back up the contents of the userDir folder (without the node_modules sub-folder). If you have a look into that folder (typically ~/.node-red), you will see there is much more, especially if you are using persistent variables, have made changes to settings.js, installed nodes in different projects, ...

1 Like

thanks @TotallyInformation so as long as i back up the above mentioned folder as well as my flow files all should be ok?

You should be. I've previously shared some daily/weekly/monthly shell scripts that will back up your userDir on Linux.

Worth noting though that the projects folder is also inside the userDir so you would want to exclude that folder as well as node_modules.

The reason for excluding node_modules is that it contains all of the installed node.js modules and, if you are restoring, you should do a npm install in the userDir folder to get the right versions installed. Also, that folder gets VERY big so backing it up is just a waste of backup space.

Do review the userDir folder though, it can get all sort of stuff in it.

Personally I am not convinced that it is worth using projects unless you want to manage multiple projects on one system. I use git manually to manage it, committing everything in the .node-red folder except for these (which are in .gitignore so that git ignores them.

*.backup*
node_modules
nodes
package.json.formatted
dist
context
.config.users.json

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