Make a backup BEFORE upgrading

Note to self:

I MUST remember to make a full backup of the SD card BEFORE attempting to upgrade a 4 year old Jessie NR install

Or in fact DON'T DO IT!!!!

:frowning:

1 Like

I'm sure you can rescue the flow files... but yeah - Jessie is two OS versions old... and went out fo service last June...

I've kept it on Jessie as LIRC still works on it and I left it alone once LIRC started having issues on Stretch and Buster

My (faulty) thinking was - lets try this 1.3.0 out on my most minimal install

Didn't quite think it thru

Its now busy doing an apt update/upgrade but that's more in the hope of your install script working rather than likely :slight_smile:

if you are that far back it may be safer to do it manually... eg just make sure npm is 6.x
sudo npm i -g npm@6 (if not already there) . Then sudo npm i -g --unsafe-perm node-red@latest then cd ~/.node-red and npm update - and then restart. IE avoid letting script try to update node.js and other things that won't work on Jessie.

(I don't still have Jessie - but I do have Stretch running nodejs 8.11 just to check - it complains about mqtt4.2.6 but seems to work)

As of next week we start to work on 2.0 - at which point we will drop Node8 and 10 so consider this the last shout for Jessie.

2 Likes

Generally safest to do things manually I find :slight_smile:

But yes, I've also been caught out by this in the past even when upgrading manually (all my installs are "standard" in the sense that I use apt and npm to install everything I can rather than someone else's script (where I probably don't fully know what is going on - even though Dave's script is certainly excellent!). Guess I'm just a control freak.

Any major upgrade of either node.js or Node-RED always deserves an initial backup - because I install node-red into its own folder with the userDir folder as a sub-folder, I can simply copy the whole top-level folder - that's it, a complete working system. Easily restored.

In fact, as I posted a while back, I now use a daily/weekly/monthly backup script which uses links to keep space usage to a minimum. So I no longer need to worry about going back a day (or several or 1/multiple weeks or months).

Confession time....
Before you posted your instructions........ I used apt-get to install the old standard NR (0.15 or something with node.js 0.19 or thereabouts!)

It got me back up working but the GPIO nodes didn't work ,and since this is my Kitchen PIR occupancy detector as well as IR relay - that was a bit of a problem! :slight_smile:

So I've spent the last n hours trying to undo this damage and get back to the 21st century :slight_smile:

I've had to add/remove/nuke from orbit npm about 20 times

Haven't tested my IR relay flow yet -as family are watching Sky box in living room and WON'T appreciate me testing at the time :slight_smile:

But the PIR bit is working :slight_smile:

I PROMISE I won't ever ever EVER do this again :slight_smile:

And having downgraded back to latest node.js 10.24.1 - everything in the garden looks lovely :slight_smile:
image

[edit this is info I used to re-install node.js - just substitute 10.24.1 for 11.15.0/ XX.XX.X

I'll update this info if v10 gets anymore updates before it becomes unmaintained at end of April 2010
]

I don't recommend that. Look a little further on the Node.js site and you will find the links to apt repositories. Follow the instructions to install those to your Pi and then future Node.js upgrades become part of your usual sudo apt update && sudo apt upgrade routine. Also, that approach ensures you actually have to think when a major version change comes along because you need to do a one-off to move to the new version.

This is about recovering from a situation I should never have got myself into in the first place :slight_smile:

Should have followed Rule 1 - if it's not broke - don't mess with it :slight_smile:

I'd never apt updated/upgraded it for years - I just had a moment of faulty thinking when I decided that this was the machine to try 1.3 out on :slight_smile:

One thing I didn't mention - this is a PiZero so AIUI, there are no official pre-built binaries for node.js for arm6 beyond 10.24.1 so this is where this machine is going to stay at from now on :slight_smile:

1 Like

Yes, we've all been there far too many times :slight_smile:

Yes, but where's the fun in that!

On a more serious note, though it is a pain, I personally find that keeping up-to-date is less painful than eventually hitting a brick wall and being forced to do so then realising that the system is so far behind that it would be quicker to build a new one from the ground up. I've experienced this far too many times in my professional life too when dealing with many different organisations.

So much so that even in enterprise environments I now have little resistance to getting organisations onto "evergreen" update schedules. While they give you a fairly constant stream of annoyances from unexpected changes, they keep you away from the massive upgrade programmes that otherwise become necessary. Those typically run into the millions if not 10's of millions of £ and many months of disruption. What you are seeing here is the same thing on a small scale.

Hmm, OK another constraint then, agreed.

14.16 is available from https://unofficial-builds.nodejs.org

This script will install it for you on a Pi Zero (I pinched this from the official pi install script I think).

#!/usr/bin/env sh

# Install Node.js for Armv6

tgta=14.16.1 

curl -sSL -o /tmp/node.tgz https://unofficial-builds.nodejs.org/download/release/v$tgta/node-v$tgta-linux-armv6l.tar.gz
# unpack it into the correct places
hd=$(head -c 9 /tmp/node.tgz)
if [ "$hd" == "<!DOCTYPE" ]; then
    CHAR="$CROSS File $f not downloaded";
else
    sudo tar -zxf /tmp/node.tgz --strip-components=1 -C /usr
fi
# remove the tgz file to save space
rm /tmp/node.tgz
1 Like

Thanks for the info :slight_smile:

But this is now staying at node 10 :slight_smile:

In all the ups and downs I had trying to get it back working , I remember seeing error messages about my Jessie libraries not being at high enough versions so I think it prob stands a good chance of failing if I tried it

1 Like

Presumably you are now going to make an image backup. Which reminds me ...

Then you can safely experiment, should you be in the mood.

1 Like

From a sign on my desk for years:
Blessed is the pessimist, for he shall have made backups

1 Like

And blessed is the careful pessimist, for he/she/they shall have made 3 backups and sent at least one of them offsite! :grinning:

1 Like

Amen :slight_smile:

..........