Upgrade from 1.2.9 to 2.1.3

Hi all,

I'm afraid to upgrade from 1.2.9 Nodered to 2.1.3.
I want to know if there is some node that become not compatible with the last version of node red ? Some things to check before upgrade ?

Also, how to delete all nodes in nodered to have a empty/defaut state like "New Project" in many software ?

Thank you very much,

The important thing is to have a good backup. You should be backing up everything in the .node-red folder except the node_modules folder. Then you can always go back to where you were.

What hardware and OS are you running on and what does this command show
node -v

Do you also want to remove any additional nodes you have installed? If so then you can delete (or rename in case you want to go back) the .node-red folder and that will remove everything. When you start node-red again it will recreate it with an empty flows file.
If you want additional nodes still to be installed then just remove the flows file, which will be flows.json or flows_servername.json. and the credentials file, which will be the same but with _cred before .json. If you have made any changes to settings.js then remove that too.
Before doing that make sure you have a good backup as I said.

I have installed node red with snap. Terminal said me command no found, install it with apt install nodejs.

My node red to upgrade run in a laptop local with a Ubuntu Studio linux.

I don't know anything about installing with snap.

It must be embedded in the snap then.

The usual method of installing on Ubuntu/Debian/Raspbian is Running on Raspberry Pi : Node-RED

Did you find the .node-red folder and the flows file etc? Check the dates on the flow file to make sure it is the correct one.

I don't know of any reason that you should not remove the snap and then install using the script in the link. Then you will be using the method that most here know about. If you do that when you start node-red it appears you have lost your flows then do not panic, it is just that it is not looking at the right file. We can sort that out easily.

Yes, it's a best method, i have tested it in a virtual machine. I installed nodered v2.1.3 on a VM, and i will try my flows from v1.2.9.

Good way ?

If you copy across the whole .node-red folder apart from node_modules and then go in to that folder and run
npm install
it will automatically install any additional nodes you had previously installed. Then you just need to restart node-red.

Ok, to be clear :

1°) I save all .node-red folder without node_modules folder from Nodered v1.2.9
2°) I replace original .node-red folder of v2.1.3 by my saved .node-red from v1.2.9
3°) I execute npm instal (this will install any nodes i had added)
4°) I restart Node-red
5°) That all ?

Yes (but install, not instal). Run the install in the .node-red folder. npm reads package.json and package-lock.json and installs any additional nodes specified in there.

Thank you, i try it.

Okay, i did the job. I have this message after npm install command :

sylvain@sylvain-VirtualBox:~/.node-red$ npm install
added 290 packages from 315 contributors and audited 290 packages in 20.333s

16 packages are looking for funding
  run `npm fund` for details

found 1 moderate severity vulnerability
  run `npm audit fix` to fix them, or `npm audit` for details

I tryed to fix with npm audit fix :

npm WARN node-red-contrib-ui-clock@1.0.1 requires a peer of node-red-dashboard@^2.23.2 but none is installed. You must install peer dependencies yourself.

up to date in 4.856s

16 packages are looking for funding
  run `npm fund` for details

fixed 0 of 1 vulnerability in 290 scanned packages
  1 vulnerability required manual review and could not be updated

and see details with npm audit :

=== npm audit security report ===                        
│                                Manual Review                                 │
│            Some vulnerabilities require your attention to resolve            │
│                                                                              │
│         Visit https://go.npm.me/audit-guide for additional guidance          │
│ Moderate      │ Prototype Pollution in minimist                              │
│ Package       │ minimist                                                     │
│ Patched in    │ >=0.2.1                                                      │
│ Dependency of │ node-red-node-email                                          │
│ Path          │ node-red-node-email > poplib > optimist > minimist           │
│ More info     │ https://github.com/advisories/GHSA-vh95-rmgr-6w4m            │
found 1 moderate severity vulnerability in 290 scanned packages
  1 vulnerability requires manual review. See the full report for details.

Is "node-red-node-email" has problem ?

None of those audit warnings is relevant - you can ignore them.

Ok, tk you :wink:

However, after this method, my flows.json content has not present in node red. I have done an import from nodered manualy. Normal ?

When you start node red it tells you which flows file it is using. Either rename your old file to that name, or edit settings.js to use your old file.

Ok i undersand.

    // The file containing the flows. If not set, it defaults to flows_<hostname>.json
    //flowFile: 'flows.json',

At this time, my flows from 1.2.9 is running well on 2.1.3.

Tank you very much all.

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