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 ?
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.
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.
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.
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.
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.