How to Backup and Restore a Node-RED Flow

1 min read

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.

Prerequisites

  • IBM Cloud account 
  • Operator has the Writer or Manager service access against the Cloudant instance

Step 1: Backup your Node-RED flow

  1. Log in to IBM Cloud and go to the Resource list.
  2. Expand Services and open the Cloudant service instance. The name is usually the same as your Node-RED app name:
    Expand Services and open the Cloudant service instance. The name is usually the same as your Node-RED app name.
  3. Click Launch Cloudant Dashboard to view the Cloudant contents:
    Click Launch Cloudant Dashboard to view the Cloudant contents.
  4. 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 to backup is stored in a Database with the same name as your app. Open the Database and open <Your Database name>/flow:
  5. 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:

    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:
    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

  1. Open your Node-RED app on the IBM Cloud dashboard and click Visit URL:
    Open your Node-RED app on the IBM Cloud dashboard and click Visit URL.
  2. Click Go to your Node-RED flow editor.
  3. Expand the top-right menu and click Import:
    Expand the top-right menu and click Import:
  4. Click Select a file to import. Select the backup json file and click Import
    Click Select a file to import. Select the backup json file and click Import:

Summary

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.

Learn more about Node-RED.

Be the first to hear about news, product updates, and innovation from IBM Cloud