# Help with backup location of flows

**URL:** <https://discourse.nodered.org/t/help-with-backup-location-of-flows/37601>\
**Category:** General\
**Created:** [16 December 2020 22:09 UTC](https://discourse.nodered.org/t/help-with-backup-location-of-flows/37601 "2020-12-16T22:09:34Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![finch6](https://avatars.discourse-cdn.com/v4/letter/f/9d8465/32.png) [@finch6](https://discourse.nodered.org/u/finch6)\
**Post date:** [16 December 2020 22:09 UTC](https://discourse.nodered.org/t/help-with-backup-location-of-flows/37601/1 "2020-12-16T22:09:34Z")

</div>

Hi all,

I'm a complete noob with Node Red, so please go easy - I have Node Red running on a RasPi 3.

I had a few flows on my Node Red when I decided to upgrade.  
Unfortunately the upgrade "hung" and I had to restart it. When I eventually got Node Red upgraded, all may flows were gone. It gave me some error, but I can't remember what it was... 🤦🏼‍♂️

Is there anywhere that I can look to see of there is a backup on the RasPi? The only node I really need (although having all the flows back would be awesome) is a function Node that I cannot for the life of me remember how I "programmed" - it took sensor readings from a Sonoff POW R2, Status8 command and sent it to a InfluxDB node. But I can't get it working, hence needing the backup...

Any help would be really awesome.  
Thanks in advance everyone 😁

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [16 December 2020 22:36 UTC](https://discourse.nodered.org/t/help-with-backup-location-of-flows/37601/2 "2020-12-16T22:36:05Z")

</div>

With a standard install, your flows are in `~/.node-red`.

---

<div class="post-metadata">

**Author:** ![gr1nch](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/gr1nch/32/14302_2.png) [@gr1nch](https://discourse.nodered.org/u/gr1nch)\
**Post date:** [18 December 2020 09:07 UTC](https://discourse.nodered.org/t/help-with-backup-location-of-flows/37601/3 "2020-12-18T09:07:00Z")

</div>

Like the OP all my flows, which I spent countless hours on, are gone. Stupidly I did not make a backup of any file in the ~/.node-red directory. I'll figure out a way to do this automatically, either locally or over the network, e.g. to github. If you don't make backups, consider it. Do not assume that nodejs, node-red are stable enough to not have it hit you. The alternative will be inevitably very painful and time consuming.

---

<div class="post-metadata">

**Author:** ![finch6](https://avatars.discourse-cdn.com/v4/letter/f/9d8465/32.png) [@finch6](https://discourse.nodered.org/u/finch6)\
**Post date:** [18 December 2020 17:58 UTC](https://discourse.nodered.org/t/help-with-backup-location-of-flows/37601/4 "2020-12-18T17:58:31Z")

</div>

Thanks @TotallyInformation, appreciate the reply.  
I found the flows.json file. Will this have all the old flows or only the current flows in my Node-Red?

If this will only have the current flows, is there anywhere I can try looking for older flows that may be "backed up" somewhere?

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [18 December 2020 18:16 UTC](https://discourse.nodered.org/t/help-with-backup-location-of-flows/37601/5 "2020-12-18T18:16:31Z")

</div>

> [@gr1nch](#):
>
> Do not assume that nodejs, node-red are stable enough to not have it hit you

The issue is not node-red nor is it node - the issue is universal. If you don't do a backup, expect to get burned.

How did you lose flows? HDD failure? SD card failure? Mis-operation? Install rouge node?

---

<div class="post-metadata">

**Author:** ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)\
**Post date:** [18 December 2020 18:18 UTC](https://discourse.nodered.org/t/help-with-backup-location-of-flows/37601/6 "2020-12-18T18:18:27Z")

</div>

> [@finch6](#):
>
> If this will only have the current flows, is there anywhere I can try looking for older flows that may be "backed up" somewhere?

The flows file only contains your current flows.

Node-RED keeps _one_ level of backup whenever you press the Deploy button - you'll find a file called `.flows.json.backup` alongside your `flows.json` file.

Note you need to also backup the `flows_cred.json` file - as that contains any credentials used by your flow.

---

<div class="post-metadata">

**Author:** ![finch6](https://avatars.discourse-cdn.com/v4/letter/f/9d8465/32.png) [@finch6](https://discourse.nodered.org/u/finch6)\
**Post date:** [18 December 2020 18:41 UTC](https://discourse.nodered.org/t/help-with-backup-location-of-flows/37601/7 "2020-12-18T18:41:47Z")

</div>

Damn, so I'm fresh out of luck then...  
Oh well, guess this is as good a time as any to build my flows from the ground up again..

Thanks for all your help everyone

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [18 December 2020 20:44 UTC](https://discourse.nodered.org/t/help-with-backup-location-of-flows/37601/8 "2020-12-18T20:44:16Z")

</div>

Are there any other files in the .node-red folder that you don't know what they are?

---

<div class="post-metadata">

**Author:** ![gr1nch](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/gr1nch/32/14302_2.png) [@gr1nch](https://discourse.nodered.org/u/gr1nch)\
**Post date:** [18 December 2020 23:28 UTC](https://discourse.nodered.org/t/help-with-backup-location-of-flows/37601/9 "2020-12-18T23:28:05Z")

</div>

I was installing zigbee2mqtt on the same machine as node-red and the logs said there was an error with the version of node, it did not support 10.\* so I tried to downgrade my node install which didn't work. I decided to install node afresh using the script

```auto
bash <(curl -sL https://raw.githubusercontent.com/node-red/linux-installers/master/deb/update-nodejs-and-nodered)

```

which doesn't remove the flows. Apart from that I can't tell what could have removed them, certainly my bash history shows that I didn't explicitly remove them.

The bottom line is I was kicking myself for not making regular backups. The git integration in 1.2 sounds perfect for my needs. node-red in operation has always been rock solid for me, its just the nodes/flow file integrity hasn't been reliable (this is the second time I've burnt myself! ☹ ) and that may well be node, not node-red, I just don't know at this stage. It was a shock when I realised that all my carefully curated flows were gone forever.

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [19 December 2020 00:05 UTC](https://discourse.nodered.org/t/help-with-backup-location-of-flows/37601/10 "2020-12-19T00:05:00Z")

</div>

what operating system is this?

Mac has time machine, window has "previous versions" (unsure about linux)

Have you searched your entire computer? (PS, windows search is just terrible - dont bother)

On windows, I use a program called "agent ransack" to search whole computer for any file named \*.json and to search inside that file for something I remember from my flow

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/3/0/305338092012fd13f24111b133cd319326b5c36b.png)

---

<div class="post-metadata">

**Author:** ![gr1nch](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/gr1nch/32/14302_2.png) [@gr1nch](https://discourse.nodered.org/u/gr1nch)\
**Post date:** [27 December 2020 00:35 UTC](https://discourse.nodered.org/t/help-with-backup-location-of-flows/37601/11 "2020-12-27T00:35:48Z")

</div>

> [@Steve-Mcl](#):
>
> what operating system is this?  
> ...

Raspbian GNU/Linux 10 (buster)

For anyone in a similar situation, I now use a simple alias command to manually and crudely backup my nodes (this went into ~/.bashrc)

```auto
alias backup_node_red='tar zcvf ~/node-red-$(date +%Y%m%d).tgz --exclude "node_modules" --exclude "lib" ~/.node-red'

```

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [27 December 2020 15:21 UTC](https://discourse.nodered.org/t/help-with-backup-location-of-flows/37601/12 "2020-12-27T15:21:02Z")

</div>

I posted a backup script a short while ago:

[Node-RED Backup script (BASH & RSYNC) - Share Your Projects - Node-RED Forum](https://discourse.nodered.org/t/node-red-backup-script-bash-rsync/37939).

It keeps 7 daily and 12 monthly backups as written but would be easily amended.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [25 February 2021 15:21 UTC](https://discourse.nodered.org/t/help-with-backup-location-of-flows/37601/13 "2021-02-25T15:21:02Z")

</div>

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
