This article is a sequel of our Node-Red series of tutorials and focuses on Backup & Restore of Node-Red data. We can backup a node, a flow (number of nodes connected to each others make a flow) or complete Node-Red data using various methods.
Import & Export Menu:
- Select a node or flow, go to Node-Red menu and click on Export.
- You can export:
- selected nodes.
- current flow i.e. all the nodes located under a given flow tab.
- all flows i.e. all the nodes of a Node-Red instance.
- Choose selected nodes on Export tab.
- Click on JSON and Copy to clipboard.
- Now you can:
- Save the data by pasting it in to a text file.
- Import it to another Node-Red instance.
- For importing, go to
- Node-Red menu and click on Import.
- Paste the JSON data in Clipboard section and hit Import.
- Nodes / Flows are now float over the Node-Red window, click to place them and Hit Deploy.
Old School Full Data Backup & Restore:
- Copy all files located in the
Pi Home\pi\.node-reddirectory and save it.
- Run the Node-Red for the first time in new machine, so that all configurational files are created.
- Paste the files copied before, in the same directory on a new machine.
- Remember to change the xxx of
flows_xxx_cred.jsonfiles according to the hostname of new machine.
- Restart the Node-Red by command
sudo systemctl restart nodered.service.