Node-RED is an open source programming tool for wiring hardware devices and services on the Internet and APIs.
IBM Cloud offers a preconfigured Node-RED starter kit on its Cloud Foundry (CF) space.
When you deploy the Node-RED starter kit, a Cloudant service instance will also be deployed. Node-RED on IBM Cloud is preconfigured to store its credential information and flow data in the bundled Cloudant. In this article, we are going to share how to backup the flow data in case of migration or in preparation for disaster recovery.
- IBM Cloud account
- Operator has the Writer or Manager service access against the Cloudant instance
Step 1: Backup your Node-RED flow
- Log in to IBM Cloud and go to the Resource list.
- Expand Services and open the Cloudant service instance. The name is usually the same as your Node-RED app name:
- Click Launch Cloudant Dashboard to view the Cloudant contents:
- The flow to backup is stored in a Database with the same name as your app. Open the Database and open <Your Database name>/flow:
The flow data is in json format and its full string is within "flow": . Copy the json in the section, including [ and ] at the beginning and the end, and save it as a file with .json extension. Note: Do not include "flow": in the json file:
Step 2: Restore your Node-RED flow
- Open your Node-RED app on the IBM Cloud dashboard and click Visit URL:
- Click Go to your Node-RED flow editor.
- Expand the top-right menu and click Import:
- Click Select a file to import. Select the backup json file and click Import
By following these steps, you'll be able to backup and restore your Node-RED flows. This can be particularly helpful in case of drastic changes, migrations, or for disaster recovery purposes.