# Make a backup BEFORE upgrading

**URL:** https://discourse.nodered.org/t/make-a-backup-before-upgrading/43875
**Category:** General
**Created:** [8 April 2021 16:36 UTC](https://discourse.nodered.org/t/make-a-backup-before-upgrading/43875 "2021-04-08T16:36:43Z")
**Posts on this page:** 17
**Page:** 1

<div class="post-metadata">

### Author: ![cymplecy](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cymplecy/32/2773_2.png) [@cymplecy](https://discourse.nodered.org/u/cymplecy)
#### Post date: [8 April 2021 16:36 UTC](https://discourse.nodered.org/t/make-a-backup-before-upgrading/43875/1 "2021-04-08T16:36:43Z")

</div>

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!!!!

☹

---

<div class="post-metadata">

### Author: ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)
#### Post date: [8 April 2021 16:51 UTC](https://discourse.nodered.org/t/make-a-backup-before-upgrading/43875/2 "2021-04-08T16:51:54Z")

</div>

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

---

<div class="post-metadata">

### Author: ![cymplecy](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cymplecy/32/2773_2.png) [@cymplecy](https://discourse.nodered.org/u/cymplecy)
#### Post date: [8 April 2021 16:55 UTC](https://discourse.nodered.org/t/make-a-backup-before-upgrading/43875/3 "2021-04-08T16:55:46Z")

</div>

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 🙂

---

<div class="post-metadata">

### Author: ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)
#### Post date: [8 April 2021 18:07 UTC](https://discourse.nodered.org/t/make-a-backup-before-upgrading/43875/4 "2021-04-08T18:07:18Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)
#### Post date: [8 April 2021 21:24 UTC](https://discourse.nodered.org/t/make-a-backup-before-upgrading/43875/5 "2021-04-08T21:24:05Z")

</div>

Generally safest to do things manually I find 🙂

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

---

<div class="post-metadata">

### Author: ![cymplecy](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cymplecy/32/2773_2.png) [@cymplecy](https://discourse.nodered.org/u/cymplecy)
#### Post date: [9 April 2021 08:49 UTC](https://discourse.nodered.org/t/make-a-backup-before-upgrading/43875/6 "2021-04-09T08:49:30Z")

</div>

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! 🙂

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

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 🙂

But the PIR bit is working 🙂

I PROMISE I won't ever ever EVER do this again 🙂

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/e/8/e88fc840c7ae40922d8db2c715b423e99bff107c.jpeg)

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/1/3/13d9912718553536cfc175f2796d9b946a7f9662.jpeg)

---

<div class="post-metadata">

### Author: ![cymplecy](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cymplecy/32/2773_2.png) [@cymplecy](https://discourse.nodered.org/u/cymplecy)
#### Post date: [9 April 2021 09:04 UTC](https://discourse.nodered.org/t/make-a-backup-before-upgrading/43875/7 "2021-04-09T09:04:08Z")

</div>

And having downgraded back to latest node.js 10.24.1 - everything in the garden looks lovely 🙂  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/2/a/2a8f93f679681f6a923a9aeab46cdbfa4407d23d.jpeg)

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

> **[How to install Node JS and NPM on the Raspberry Pi](https://www.makersupplies.sg/blogs/tutorials/how-to-install-node-js-and-npm-on-the-raspberry-pi)**
>
> So you want to use your Raspberry Pi as a NodeJS server? You are at the right place! In this short tutorial we will go through how to install NodeJS and the Node Package Manager (NPM) on the Raspberry Pi. Step 1: Update & Upgrade your Pi To...

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

---

<div class="post-metadata">

### Author: ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)
#### Post date: [9 April 2021 11:51 UTC](https://discourse.nodered.org/t/make-a-backup-before-upgrading/43875/8 "2021-04-09T11:51:09Z")

</div>

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.

> **[Installing Node.js via package manager | Node.js](https://nodejs.org/en/download/package-manager/#debian-and-ubuntu-based-linux-distributions)**
>
> Node.js® is a JavaScript runtime built on Chrome's V8 JavaScript engine.

---

<div class="post-metadata">

### Author: ![cymplecy](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cymplecy/32/2773_2.png) [@cymplecy](https://discourse.nodered.org/u/cymplecy)
#### Post date: [9 April 2021 12:04 UTC](https://discourse.nodered.org/t/make-a-backup-before-upgrading/43875/9 "2021-04-09T12:04:55Z")

</div>

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

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

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 🙂

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 🙂

---

<div class="post-metadata">

### Author: ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)
#### Post date: [9 April 2021 12:54 UTC](https://discourse.nodered.org/t/make-a-backup-before-upgrading/43875/10 "2021-04-09T12:54:45Z")

</div>

> [@cymplecy](#):
>
> This is about recovering from a situation I should never have got myself into in the first place

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

> [@cymplecy](#):
>
> Should have followed Rule 1 - if it's not broke - don't mess with it

Yes, but where's the fun in that!

> [@cymplecy](#):
>
> 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

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.

> [@cymplecy](#):
>
> PiZero

Hmm, OK another constraint then, agreed.

---

<div class="post-metadata">

### Author: ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)
#### Post date: [9 April 2021 13:00 UTC](https://discourse.nodered.org/t/make-a-backup-before-upgrading/43875/11 "2021-04-09T13:00:48Z")

</div>

> [@cymplecy](#):
>
> AIUI, there are no official pre-built binaries for node.js for arm6 beyond 10.24.1

14.16 is available from [https://unofficial-builds.nodejs.org](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).

```auto
#!/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

```

---

<div class="post-metadata">

### Author: ![cymplecy](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cymplecy/32/2773_2.png) [@cymplecy](https://discourse.nodered.org/u/cymplecy)
#### Post date: [9 April 2021 13:04 UTC](https://discourse.nodered.org/t/make-a-backup-before-upgrading/43875/12 "2021-04-09T13:04:32Z")

</div>

Thanks for the info 🙂

But this is now staying at node 10 🙂

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

---

<div class="post-metadata">

### Author: ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)
#### Post date: [9 April 2021 13:33 UTC](https://discourse.nodered.org/t/make-a-backup-before-upgrading/43875/13 "2021-04-09T13:33:06Z")

</div>

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

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

---

<div class="post-metadata">

### Author: ![gerry](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/gerry/32/21604_2.png) [@gerry](https://discourse.nodered.org/u/gerry)
#### Post date: [9 April 2021 16:22 UTC](https://discourse.nodered.org/t/make-a-backup-before-upgrading/43875/14 "2021-04-09T16:22:47Z")

</div>

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

---

<div class="post-metadata">

### Author: ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)
#### Post date: [9 April 2021 17:17 UTC](https://discourse.nodered.org/t/make-a-backup-before-upgrading/43875/15 "2021-04-09T17:17:29Z")

</div>

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

---

<div class="post-metadata">

### Author: ![cymplecy](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cymplecy/32/2773_2.png) [@cymplecy](https://discourse.nodered.org/u/cymplecy)
#### Post date: [9 April 2021 17:18 UTC](https://discourse.nodered.org/t/make-a-backup-before-upgrading/43875/16 "2021-04-09T17:18:50Z")

</div>

Amen 🙂

..........

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)
#### Post date: [8 June 2021 17:19 UTC](https://discourse.nodered.org/t/make-a-backup-before-upgrading/43875/17 "2021-06-08T17:19:05Z")

</div>

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