Fresh install Raspberry Pi OS and node-RED, copied old .json files, no flows

Hi,

Had some problems with the recent Buster Lite and node-Red on a Rpi4 B, so decided to a fresh Raspberry Pi OS 64B Lite installation on a new SDCard. After the booting I installed the update/upgrade and now I can manage the Pi via SSH. Then I ran this script and before a poured the coffee, it was there, a new OS and node-RED installation. :+1: for that script.
After the node-RED installation I copied from the old to the nwe SDCard the files, package.json, flows_Rpi4_cred.json and flows_Rpi4.json and renamed them to the new hostname.
I restart nod-RED, but there are no flows and no nodes from my old installation.
Did I forgot something?

Run
node-red-start
And see which flows file it is using.

To install the nodes you must run
npm install
From the .node-red folder.

Thank you Collin,

Start Node-RED

Once Node-RED has started, point a browser at http://192.168.1.54:1880
On Pi Node-RED works better with the Firefox or Chrome browser

Use   node-red-stop                          to stop Node-RED
Use   node-red-start                         to start Node-RED again
Use   node-red-log                           to view the recent log output
Use   sudo systemctl enable nodered.service  to autostart Node-RED at every boot
Use   sudo systemctl disable nodered.service to disable autostart on boot

To find more nodes and example flows - go to http://flows.nodered.org
[sudo] password for Maru:

Starting as a systemd service.
^Z
[1]+  Stopped                 node-red-start
Maru@RPi4:~/.node-red $ npm install
npm ERR! code ENOENT
npm ERR! syscall spawn git
npm ERR! path git
npm ERR! errno -2
npm ERR! enoent An unknown git error occurred
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/Maru/.npm/_logs/2023-07-15T14_18_26_818Z-debug-0.log

I guess you didn't see the bit on the page you linked to:
"You may need to run sudo apt install build-essential git curl first to ensure npm is able to fetch and build any binary modules it needs to install"

Indeed I missed that. :+1:
What is the best to do now:
stop node-RED > run sudo apt install build-essential git curl and after that install nod-RED again?

There was a time when the default name for the flows file was flows_<hostname>.json
But now I'm pretty sure it's just flows.json and flows_cred.json.

Try renaming your files without _Rpi4 or edit settings.js to point to the old filenames.

No need to reinstall node red. Install the extras then do the npm install again.

Start Node-RED

Once Node-RED has started, point a browser at http://192.168.1.54:1880
On Pi Node-RED works better with the Firefox or Chrome browser

Use   node-red-stop                          to stop Node-RED
Use   node-red-start                         to start Node-RED again
Use   node-red-log                           to view the recent log output
Use   sudo systemctl enable nodered.service  to autostart Node-RED at every boot
Use   sudo systemctl disable nodered.service to disable autostart on boot

To find more nodes and example flows - go to http://flows.nodered.org
[sudo] password for Maru:

Starting as a systemd service.
15 Jul 17:32:41 - [info]
Welcome to Node-RED
===================
15 Jul 17:32:41 - [info] Node-RED version: v3.0.2
15 Jul 17:32:41 - [info] Node.js  version: v16.20.1
15 Jul 17:32:41 - [info] Linux 6.1.21-v8+ arm64 LE
15 Jul 17:32:43 - [info] Loading palette nodes
15 Jul 17:32:44 - [info] Settings file  : /home/Maru/.node-red/settings.js
15 Jul 17:32:44 - [info] Context store  : 'default' [module=memory]
15 Jul 17:32:44 - [info] User directory : /home/Maru/.node-red
15 Jul 17:32:44 - [warn] Projects disabled : editorTheme.projects.enabled=false
15 Jul 17:32:44 - [info] Flows file     : **/home/Maru/.node-red/flows.json**
15 Jul 17:32:44 - [info] Creating new flow file
15 Jul 17:32:44 - [warn]
---------------------------------------------------------------------
Your flow credentials file is encrypted using a system-generated key.
If the system-generated key is lost for any reason, your credentials
file will not be recoverable, you will have to delete it and re-enter
your credentials.
You should set your own key using the 'credentialSecret' option in
your settings file. Node-RED will then re-encrypt your credentials
file using your chosen key the next time you deploy a change.
---------------------------------------------------------------------
15 Jul 17:32:44 - [warn] Encrypted credentials not found
15 Jul 17:32:44 - [info] Starting flows
15 Jul 17:32:44 - [info] Started flows
15 Jul 17:32:44 - [info] Server now running at http://127.0.0.1:1880/

This is the output, still no flows and /home/Maru/.node-red/flows.json is not existing

Thank you @jbudd, I thought the same and I renamed them and started node-RED:

Maru@RPi4:~/.node-red $ ls -l
total 1520
-rw-r--r-- 1 Maru Maru 731951 Jul 15 19:01 flows.json
-rw-r--r-- 1 Maru Maru   6112 Jul 15 00:06 flows_RPi4_cred.json
-rw-r--r-- 1 Maru Maru 731951 Jul 15 00:07 flows_RPi4.json
drwxr-xr-x 3 Maru Maru   4096 Jul 14 22:56 lib
drwxr-xr-x 3 Maru Maru  40960 Jul 15 17:14 node_modules
-rw-r--r-- 1 Maru Maru   5074 Jul 15 00:08 package.json
-rw-r--r-- 1 root root  22614 Jul 14 22:56 settings.js
Maru@RPi4:~/.node-red $ cp flows_RPi4_cred.json flows_cred.json
Maru@RPi4:~/.node-red $ node-red-start

Start Node-RED

Once Node-RED has started, point a browser at http://192.168.1.54:1880
On Pi Node-RED works better with the Firefox or Chrome browser

Use   node-red-stop                          to stop Node-RED
Use   node-red-start                         to start Node-RED again
Use   node-red-log                           to view the recent log output
Use   sudo systemctl enable nodered.service  to autostart Node-RED at every boot
Use   sudo systemctl disable nodered.service to disable autostart on boot

To find more nodes and example flows - go to http://flows.nodered.org

Starting as a systemd service.

It stil can't find the flow file

It looks if your right with the filenames :+1: Did not copy well first time, but now it looks better:

Start Node-RED

Once Node-RED has started, point a browser at http://192.168.1.54:1880
On Pi Node-RED works better with the Firefox or Chrome browser

Use   node-red-stop                          to stop Node-RED
Use   node-red-start                         to start Node-RED again
Use   node-red-log                           to view the recent log output
Use   sudo systemctl enable nodered.service  to autostart Node-RED at every boot
Use   sudo systemctl disable nodered.service to disable autostart on boot

To find more nodes and example flows - go to http://flows.nodered.org

Starting as a systemd service.
15 Jul 19:13:00 - [info]
Welcome to Node-RED
===================
15 Jul 19:13:00 - [info] Node-RED version: v3.0.2
15 Jul 19:13:00 - [info] Node.js  version: v16.20.1
15 Jul 19:13:00 - [info] Linux 6.1.21-v8+ arm64 LE
15 Jul 19:13:02 - [info] Loading palette nodes
15 Jul 19:13:03 - [info] Settings file  : /home/Maru/.node-red/settings.js
15 Jul 19:13:03 - [info] Context store  : 'default' [module=memory]
15 Jul 19:13:03 - [info] User directory : /home/Maru/.node-red
15 Jul 19:13:03 - [warn] Projects disabled : editorTheme.projects.enabled=false
15 Jul 19:13:03 - [info] Flows file     : /home/Maru/.node-red/flows.json
15 Jul 19:13:03 - [info] Server now running at http://127.0.0.1:1880/
15 Jul 19:13:03 - [warn]
---------------------------------------------------------------------
Your flow credentials file is encrypted using a system-generated key.
If the system-generated key is lost for any reason, your credentials
file will not be recoverable, you will have to delete it and re-enter
your credentials.
You should set your own key using the 'credentialSecret' option in
your settings file. Node-RED will then re-encrypt your credentials
file using your chosen key the next time you deploy a change.
---------------------------------------------------------------------
15 Jul 19:13:03 - [warn] Error loading credentials: SyntaxError: Unexpected token � in JSON at position 0
15 Jul 19:13:03 - [warn] Error loading flows: Error: Failed to decrypt credentials
15 Jul 19:13:03 - [info] Waiting for missing types to be registered:
15 Jul 19:13:03 - [info]  - ui_base
15 Jul 19:13:03 - [info]  - twitter-credentials (provided by npm module node-red-node-twitter)
15 Jul 19:13:03 - [info]  - ui_group
15 Jul 19:13:03 - [info]  - ui_tab
15 Jul 19:13:03 - [info]  - influxdb
15 Jul 19:13:03 - [info]  - pushover-keys
15 Jul 19:13:03 - [info]  - ui_spacer
15 Jul 19:13:03 - [info]  - dropbox-config
15 Jul 19:13:03 - [info]  - serial-port (provided by npm module node-red-node-serialport)
15 Jul 19:13:03 - [info]  - yield
15 Jul 19:13:03 - [info]  - pushover
15 Jul 19:13:03 - [info]  - twitter in (provided by npm module node-red-node-twitter)
15 Jul 19:13:03 - [info]  - sentiment (provided by npm module node-red-node-sentiment)
15 Jul 19:13:03 - [info]  - feedparse (provided by npm module node-red-node-feedparser)
15 Jul 19:13:03 - [info]  - google-tts
15 Jul 19:13:03 - [info]  - ui_template
15 Jul 19:13:03 - [info]  - ui_audio
15 Jul 19:13:03 - [info]  - ui_button
15 Jul 19:13:03 - [info]  - ui_text
15 Jul 19:13:03 - [info]  - do
15 Jul 19:13:03 - [info]  - do-return
15 Jul 19:13:03 - [info]  - cast-to-client
15 Jul 19:13:03 - [info]  - ui_chart
15 Jul 19:13:03 - [info]  - ui_gauge
15 Jul 19:13:03 - [info]  - ui_led
15 Jul 19:13:03 - [info]  - random
15 Jul 19:13:03 - [info]  - base64
15 Jul 19:13:03 - [info]  - influxdb out
15 Jul 19:13:03 - [info]  - pushover api
15 Jul 19:13:03 - [info]  - influxdb in
15 Jul 19:13:03 - [info]  - unit-converter
15 Jul 19:13:03 - [info]  - calculator
15 Jul 19:13:03 - [info]  - jsonata
15 Jul 19:13:03 - [info]  - convert
15 Jul 19:13:03 - [info]  - ui_switch
15 Jul 19:13:03 - [info]  - moment
15 Jul 19:13:03 - [info]  - worldmap-tracks
15 Jul 19:13:03 - [info]  - counter
15 Jul 19:13:03 - [info]  - cayennelpp-decoder
15 Jul 19:13:03 - [info]  - influxdb batch
15 Jul 19:13:03 - [info]  - ui_dropdown
15 Jul 19:13:03 - [info]  - ui_numeric
15 Jul 19:13:03 - [info]  - ui_toast
15 Jul 19:13:03 - [info]  - ui_ui_control
15 Jul 19:13:03 - [info]  - wake on lan
15 Jul 19:13:03 - [info]  - dropbox out
15 Jul 19:13:03 - [info]  - dsm
15 Jul 19:13:03 - [info]  - worldmap
15 Jul 19:13:03 - [info]  - worldmap in
15 Jul 19:13:03 - [info]  - simpletime
15 Jul 19:13:03 - [info] To install any of these missing modules, run:
15 Jul 19:13:03 - [info]   npm install <module name>
15 Jul 19:13:03 - [info] in the directory:
15 Jul 19:13:03 - [info]   /home/Maru/.node-red

and I have my flows...but missing a lot of nodes :thinking:
so I'll try to install them as discribed above :slight_smile:

Thank you @Collin and @jbudd I'll close this topic

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