Flows disappear when restarting Raspberry pi

How do I keep flows from disappearing when I power down or restart my Rpi? I don't know how to recover a flow. This doesn't seem to be consistent. I can work on a flow add nodes create functions etc. If I close my browser and re-open many times the flow that I have just worked on is gone?

DB

When you press the Deploy button - Node-RED should update your flows.json file on the Pi that NR is running on.

What I have experienced - is that if the the SD card goes into read-only mode (as its worn out) when I actually restart my Pi - the flows are gone.

They don't go until the filing system is restarted as changes are held in RAM so you don't notice that the SD-card is in a failure mode until the filing system is restarted

Doesn't sound exactly your experience but I'd blame the Pi hardware/OS software rather than Node-RED if experiencing such issues

Thanks I am going to watch for that. I will post results.

DB

Add some nodes to your flow and deploy, then look in your .node-red folder and check the timestamp on the flows file is showing the time you deployed, and note the file size. Then do a power cycle (not just a reboot, a power off, wait a minute, and power on again). Then check the file timestamp and size. If it has gone back in time then chuck the SD card in the bin and start again.

I was not always deploying changes prior to closing window. Thanks for the tip.

Loon

The browser should have warned you that you were closing it with unsaved changes. Did that not happen?

It did not! I am using FireFox on most systems. I will need to pay more attention to that.

Loon

So if you, for example, move a node and then close the window you don't get a warning?