and Happy Holidays to everybody.
I need to migrate my Node Red server from one Raspberry (Raspbian Buster) to another (Bookworm).
Is there a way to migrate it with no issue?
Can anybody please advise the procedure to do it?
The lack of issues can never be guaranteed, but if you backup everything in your .node-red folder (or whichever folder is the one with the flows and settings.js etc) except for the node_modules folder. Then, to install in the new system, restore all of that to the new .node-red folder, cd into that folder and run
which will install the extra nodes you need, and will take a little while on a low power pi or similar. Then start (or restart) node-red.
Another option, and one that I use is to do it manually.
I export all of the flows to a file.
I then take a pic of the installed nodes in the pallet.
After setting up the new node-red server, I then install of the nodes I see in the pallet pics and then import the flows.
IMHO, this also gives me a very clean setup as I am not importing anything that is not currently being used.
Node-RED install scripts
You can install Node-RED on your server then have the ability to copy the whole instance to any internet facing or non-internet facing machine. Then from your server (internet facing), you can update/add nodes for that version of Node-RED inside the editor. Then copy to the non-internet facing instance (folder/subfolders) to your working instance.
If you are just copying the whole set of files across, make sure you are copying to the same OS and version, hardware, and nodejs version. Otherwise you will probably have problems with any nodes or modules that include compiled code.
For this, as Colin says, on the new device, make sure you run
npm rebuild on both the outer folder (where Node-RED is installed) and the inner folder (which is your useDir and where most nodes are installed). If using UIBUILDER, also do a rebuild in the uibRoot folder.