How to Recover Accidentally Deleted or Changed Node-RED Flows

Node-RED is an open-source flow-based programming tool that provides an easy-to-use graphical interface for developing applications. Sometimes, you may accidentally delete or change a Node-RED flow, which can be frustrating. In this guide, we will provide step-by-step instructions on how to recover accidentally deleted or changed Node-RED flows.

Instructions

  1. Stop immediately doing anything in Node-RED.
  2. Open UMHLens / OpenLens and navigate to the Node-RED pod.
  3. Open the shell of that pod
  4. Enter the following command in the console to restore the backup:
    cp /data/.flows.json.backup /data/flows.json

    This will restore the old backup and recover the lost flow.
  5. Close the console.