Skip to content

How to backup flows and related configuration

Julian Knight edited this page Apr 28, 2017 · 6 revisions

Where are things that need backing up?

If Node-RED has been installed as standard, all user files should be contained in ~/.node-red unless the userDir setting has been changed in ~/.node-red/settings.js. ~ refers to the home folder of the user that runs Node-RED. (on Windows, ~ is available in PowerShell but in the older cmd shell, you should use %USERPROFILE% instead).

It is also possible to start Node-RED with parameters that override the location of the userDir (--userDir or -u) and/or the settings.js file (--settings or -s).

What needs backing up?

For full safety, everything in in the userDir should be backed up except the folder called node_modules.

Important files

Here is a list of the critical files to backup. However, it is not safe to assume this is all that is needed.

  • flows_*.json & flows_*_cred.json

    These define the flows and any credentials stored for the flows. The * indicates that the actual file is named after the machine name you are running on. If you have transferred from another machine name, you might have multiple files though only one set will be active. In addition, there are *.backup versions of these files. Node-RED copies the old active flow/cred files each time you deploy.

  • .config.json

    This contains the current configuration being used. Includes a list of all of the modules and node types that are being loaded with their versions.

  • settings.js

    Defines the user global settings for Node-RED.

  • package.json

    If used (will be standard from Node-RED version 0.17), defines the extra npm modules installed such as node-red-contrib-* nodes.