Node-Red Flows – Storage and Backup

flows-backup-storageFlows that you create are stored by default in a file in the .node-red directory of your home folder in a file called flows_servername.json.

The file is created when you run node-red for the first time, and is loaded each time that you run node-red.

EG. for my raspberry pi the file is flows_raspberrypi.json.

The file will contain all of the flows in the workspace.

However it is not the only file that is created. You will also see these files.

  • flows_raspberrypi.json.backup
  • flows_raspberrypi_cred.json.
  • flows_raspberrypi_cred.json.backup

flows_raspberrypi.json.backup – This is a backup of the flows_raspberrypi.json file, and functions like a word backup.

When you do a deploy the old flows_raspberrypi.json file is moved to the backup file and the flows_raspberrypi.json is overwritten.

This means that you can recover from a mistake if you notice it after 1 deploy by using the flows_raspberrypi.json.backup file.

flows_raspberrypi_cred.json. – This file contains login data used by some nodes. If it is not present the flows will still work but you will need to add the information back in to any nodes that need it.

flows_raspberrypi_cred.json.backup – Backup of flows_raspberrypi_cred.json and functions the same way as the other backup.

Flow Backup

It is a good idea to backup your flows files on a regular basis. The automatic backup should only be considered a temporary one.

To do a complete backup then make a copy of the four files mentioned above:

  • flows_raspberrypi.json
  • flows_raspberrypi.json.backup.
  • flows_raspberrypi_cred.json.
  • flows_raspberrypi_cred.json.backup.

Note: you will need to change the names to match your flows files.

Moving Your Flows to Another Machine

You can copy all of the flows by copying the flows_newmachinebane.json. file.

To use them on another machine change the file name to flows_newmachinebane.json.

The only file you really need is the  flows_raspberrypi.json file however you should also copy the flows_raspberrypi_cred.json file.

See this github page for other important files and folders.

Creating New Flow Files

You can created additional flow files for storing different workspaces.

To use another flows file you can create a new settings file and edit it.

As an example if I wanted to create a separate flows file to store client flows I would :

  • copy the old settings file to a new one called client_settings.js
  • Edit the settings file to point to the new flows file and remove the two forward slashes.

// flowFile: clientflows.json’,

  • Start node-red using
node-red -s client_settings.js

You could also use the new flows file without creating an new settings file by using the command option

node-red clientflows.json

Notice you don’t need a switch.

Related tutorials:

Node-Red Settings.js File – Node-Red Admin

Please rate? And use Comments to let me know more
[Total: 4    Average: 1.5/5]

Leave a Reply

Your email address will not be published. Required fields are marked *