Copying user files to new install

I am running a Node-RED dashboard on a Raspberry Pi that successfully pings a number of Home Automation devices over time and displays various metrics.

All runs OK most of the time but occasionally the Pi craps itself and crashes. I have tried to do updates and upgrades on the Pi but these too end in errors. Therefore I am thinking it would be best to effectively start again, do a brand new install of Raspbian and then set Node-RED up again.

Problem is that I'm not that techy and it has taken me a long while to get this far with my dashboard. Therefore I'm looking for the best way for me to copy across all the appropriate directories, files, settings, configs, custom fonts etc etc from the old install to the new clean one.

Is anybody able to give me some simple guidance and steps to follow?

Many thanks in advance.

If you are using a standard install, all you need to do is to copy the contents of the ~/.node-red folder.

However, you can exclude the node_modules sub-folder if you like. But once you are on the new system, go into that folder in the terminal and do npm install which will reinstall all of the dependent packages from scratch. Then you can start node-red.

1 Like

I think that, unless the new system is the same hardware, OS version and nodejs major version (not sure whether the OS matters actually) that it is essential not to copy node_modules from the original. Otherwise there is a danger that any nodes that have locally compiled components will fail. Removing node_modules and running npm install will compile them for the new system.

Sorry, I should have said that. You are, of course, correct.