Hypothetical question, how would I go about restoring an individual tab (I think it’s called a flow ?) in the Node-Red add-on ? I’m envisioning a situation where I make an inadvertent mistake with a tab, and want to examine a previous version of it.
Seems like I would:
Grab a copy of most-recent snapshot
Expand the tar file in a temp directory somewhere
Find the /config/node-read/flows.json file
That’s where I get stuck. Seems like flows.json is a very long single-line of JSON, so editing that, and finding the individual flow that I want to import is challenging.
I made a little progress here. I downloaded my current flows.json, opened it in VS Code, and formatted the document. Went from 1 line to 6700 lines, and much easier to read. Appears to be a fairly flat structure. Feels like the top section maps the “tab name” to an “id”. Then there’s just a very long list of individual nodes. Perhaps I just grab all the nodes matching the id from the tab I desire ?
Maybe I should export one of my tabs to see the ideal format of the file I’m trying to artificially construct from the larger flows.json
Thanks for the reply. I guess given the growing complexity of my setup, the idea of reverting the entire Home Assistant config to see a previous version of one of my node-red flows feels a bit… too big. But I suppose the idea of reverting my test instance using my production snapshot might be worth considering.
Anyway, just wanted a second opinion on options for accessing individual flows from previous backups. Seems like I haven’t overlooked anything obvious, so thanks for chiming in on that. I suppose another option is a periodic manual export from Node-Red, but always prefer options that don’t rely on me remembering to do something
You could only revert the NR part of your snapshot (not your entire HA setup) or try to swap out the entire flows.json files instead of copying parts of it