Node-RED Upgrades (v3)

I noticed the other day that my Node-RED node was in need of an update. So I ran the script provided in the Node-RED docs. I expected it to run smoothly since it has always in the past. However, I received a message stating that the script couldn't update from v2 of Node-RED to v3 of Node-RED because I was on Nodejs v12.

Note:

Before I did anything. I went to Node-RED in my browser and hit alt-shift-P and ensured that all nodes were updated to their latest version.


Here are the steps that I took to do the upgrade.


1. Remove current installation of Nodejs:

sudo apt remove nodejs

2. Install Nodejs v14 (Node-RED recommends this version):

sudo curl -sL https://deb.nodesource.com/setup_14.x | sudo -E bash -
sudo apt-get install -y nodejs

3. Run Node-RED install script:

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

4. Start Node-RED:

node-red-start --max-old-space-size=1024 

When I visited my newly upgrade Node-RED installation in my browser I was shocked to see that all my Flows were gone! I just had an empty default Flow. I was freaking out until I remembered that I had previously setup up Projects which allowed me to backup all my Flows and creds to GithHub.

So I followed the docs and re-enabled Projects. I then went to my GitHub account and copied the flows_noderedpi.json and flows_noderedpi_cred.json to ~/.node-red on my Node-RED node. Once I restarted (node-red-restart) Node-RED everything was back in order and working. I made a few updates to take advantage of some of the new features in Node-RED and was able to easily push those changes to GitHub.

I was so happy that I had setup Projects. It was a real life saver and kept me from losing a few years worth of work that I had put into my Node-RED setup.

Posted on