# Backup flow, node-red don’t start

**URL:** <https://discourse.nodered.org/t/backup-flow-node-red-don-t-start/86422>\
**Category:** General\
**Created:** [14 March 2024 07:54 UTC](https://discourse.nodered.org/t/backup-flow-node-red-don-t-start/86422 "2024-03-14T07:54:20Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![alber4793](https://avatars.discourse-cdn.com/v4/letter/a/e36b37/32.png) [@alber4793](https://discourse.nodered.org/u/alber4793)\
**Post date:** [14 March 2024 07:54 UTC](https://discourse.nodered.org/t/backup-flow-node-red-don-t-start/86422/1 "2024-03-14T07:54:20Z")

</div>

Hello, yesterday I had a problem with the power supply and I have some corrupt files that prevent me from starting node-red. Before trying to solve this problem I would like to make a backup of my flow. Is it possible without booting the node-red?

I've tried node-red — safe but it doesn't work.  
Work on a raspberry pi 4b with raspbian

---

<div class="post-metadata">

**Author:** ![jbudd](https://avatars.discourse-cdn.com/v4/letter/j/5f8ce5/32.png) [@jbudd](https://discourse.nodered.org/u/jbudd)\
**Post date:** [14 March 2024 08:58 UTC](https://discourse.nodered.org/t/backup-flow-node-red-don-t-start/86422/2 "2024-03-14T08:58:14Z")

</div>

Hello @alber4793, welcome to the forum.

Your flows should be in ~/.node-red/flows.json and your config settings in ~/.node-red/flows\_cred.json.

In theory you could copy those two files to a new Node-red installation, but you would have to reinstall any non-standard nodes before it would work.

A more complete backup would include the whole ~/.node-red directory with the exception of the node\_modules directory.  
eg (not tested) `tar cv --exclude=.node-red/node_modules -f noderedbackup.tar .node-red`

To use this archive on a new installation, extract the backup archive, cd to .node-red and run `npm install`.

You can test this on a new SD card with no risk of overwriting your current (broken) installation.

---

<div class="post-metadata">

**Author:** ![alber4793](https://avatars.discourse-cdn.com/v4/letter/a/e36b37/32.png) [@alber4793](https://discourse.nodered.org/u/alber4793)\
**Post date:** [14 March 2024 17:11 UTC](https://discourse.nodered.org/t/backup-flow-node-red-don-t-start/86422/3 "2024-03-14T17:11:53Z")

</div>

Hello again,

I have searched for the described route but have not found my flows. I think this is going to be harder than I thought.

I have another rpi that works correctly. I have been able to locate the files in the previous post by @jbudd in home/\*\*\*  
But on the rpi that doesn't work I am not able to find the node-red folder.

I would appreciate some more help. I'm pasting a few lines of code, to see if someone can help me.

```auto

***** @raspberrypi:~ $ node-red
/usr/lib/node_modules/node-red/node_modules/ms/index.js:2
  Copyright JS Foundation and other contributors, http://js.foundation
            ^^

SyntaxError: Unexpected identifier
    at Object.compileFunction (node:vm:360:18)
    at wrapSafe (node:internal/modules/cjs/loader:1126:15)
    at Module._compile (node:internal/modules/cjs/loader:1162:27)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1252:10)
    at Module.load (node:internal/modules/cjs/loader:1076:32)
    at Function.Module._load (node:internal/modules/cjs/loader:911:12)
    at Module.require (node:internal/modules/cjs/loader:1100:19)
    at require (node:internal/modules/cjs/helpers:119:18)
    at Object.<anonymous> (/usr/lib/node_modules/node-red/node_modules/debug/src/debug.js:14:20)
    at Module._compile (node:internal/modules/cjs/loader:1198:14)
nodered.service: Main process exited, code=exited, status=1/FAILURE
nodered.service: Failed with result 'exit-code'.

```

I don't know what more information or code I should provide. I am a beginner raspberry OS user

Thanks for the help

---

<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:** [14 March 2024 17:35 UTC](https://discourse.nodered.org/t/backup-flow-node-red-don-t-start/86422/4 "2024-03-14T17:35:54Z")

</div>

It is .node-red. if you login and run  
`ls -al`  
You should see it.

---

<div class="post-metadata">

**Author:** ![alber4793](https://avatars.discourse-cdn.com/v4/letter/a/e36b37/32.png) [@alber4793](https://discourse.nodered.org/u/alber4793)\
**Post date:** [14 March 2024 18:24 UTC](https://discourse.nodered.org/t/backup-flow-node-red-don-t-start/86422/5 "2024-03-14T18:24:25Z")

</div>

Brilliant! It seems like I'm starting to have success.  
I have managed to backup the entire folder where the configurations and flows are located. Could you help me repair/know what is the problem why node-red does not work?

---

<div class="post-metadata">

**Author:** ![jbudd](https://avatars.discourse-cdn.com/v4/letter/j/5f8ce5/32.png) [@jbudd](https://discourse.nodered.org/u/jbudd)\
**Post date:** [14 March 2024 19:51 UTC](https://discourse.nodered.org/t/backup-flow-node-red-don-t-start/86422/6 "2024-03-14T19:51:43Z")

</div>

Try reinstalling Node-red:  
This should preserve your flows file.

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

```

---

<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:** [14 March 2024 21:26 UTC](https://discourse.nodered.org/t/backup-flow-node-red-don-t-start/86422/7 "2024-03-14T21:26:32Z")

</div>

> [@alber4793](#):
>
> help me repair/know what is the problem why node-red does not work

If you have corrupted files you have no way of knowing exactly what has been corrupted. Start with a new card and recreate it from scratch. That way if you discover something else you need to recover you have a chance of it still being there on the old card. Always buy good quality cards from reputable suppliers, there are a lot of poor quality cheap clones out there.  
It may be ok to later re-use the old card but it might be safer just to chuck it.

---

<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:** [12 June 2024 21:27 UTC](https://discourse.nodered.org/t/backup-flow-node-red-don-t-start/86422/8 "2024-06-12T21:27:14Z")

</div>

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