Migrating and upgrading from a very outdated NextCloudPi installation

,

I am a long-time happy user of nextcloudplus (or maybe nextcloudpi, I’m genuinely not sure). However, over the past 3 years serious health complications prevented me from keeping fully up to date with software - I had some neuro troubles which prevented me from being able to work effectively or even work out simple networking. I thought that NCP kept self-updating, but I must have missed something along the way.

These days I’m not quite full strength but I have returned to work. I still sometimes struggle with English even though it’s my first language, so please excuse any missing/incorrect words.

Since the initial installation, I think the nextcloud landscape has changed somewhat, and I need to move from the VM instance that I’m on to something a little more updated, and I’m hoping the forum here can provide some guidance given how out of date my software is.

My VM instance is still at “NextcloudPi v1.54.0”, reporting “NextCloudPi 20.0.12” from occ --version. I am aware that this is very, very old.

I think, from reading the forums, that it is sensible for me to eventually target arriving at the official AIO container instance. Advice for migration to AIO involves getting the two platforms to the same Nextcloud version, but I don’t think AIO even existed at v20.0.12 (?), and the instructions don’t cover versions that I have. The VM image that I am running is definitely based on MariaDB rather than Postgres.
Searching github suggests that even very early versions of aio were on nextcloud 23

My ideal would be to come up with a scripted process that can take the VM instance, upgrade it as necessary, migrate the files and the database (and here it gets tricky, right?), and somehow --eventually-- ends up in an aio container.

What I can do is practise this many times; I have got another host which I can isolate, and boot the VM image without affecting the running instance, so I’m willing to put the effort in “screwing around” with no consequences to me or my users’ data.

I think I will have to upgrade Nextcloud on my existing instance first, but having looked in the control panel the upgrade procedure appears to … simply die.

Does anyone know where I go from here? Thank you.

Well, I finally did it, following many practice runs and many false starts.

I’ve upgraded all the way through to Nextcloud 30 and NCP 1.55. For any future thread archeologists, here are my notes on how I did it.

Note: My backups are simply copying the ~700GBytes of VM image disks somewhere else. This isn’t the fastest method, but it’s one of the easiest to recover from. I greatly value simple recovery, and - besides - for some reason my libvirt instance was struggling to read qcow2 snapshots.

Stage 0 - set up - Increase root disk space a little, change the apt mirror to point at the default deb.debian.org in /etc/apt/sources.list (I think my local mirror was misbehaving). Backup the image files while the VM is off

Stage 1:

mysql nextcloud -e "DROP TABLE IF EXISTS oc_user_status; DROP TABLE IF EXISTS oc_recent_contact;"                                                      &&
cd /tmp                                                                                                                                                &&
/usr/bin/time -f %e bash -c "ncp-update-nc 20.0.14 && ncp-update-nc 21.0.9 && ncp-update-nc 22.2.10 && ncp-update-nc 23.0.12 && ncp-update-nc 24.0.12" &&
poweroff

Time taken for stage 1: 3233 seconds
Backup time for stage 1: 2873 seconds

Stage 2:

apt -y clean       &&
apt -y update      &&
apt -y upgrade     &&
ncp-dist-upgrade   &&
reboot

### Reconnect
cd /tmp                                                                                                                        &&
/usr/bin/time -f %e bash -c "ncp-update-nc 25.0.13 && ncp-update-nc 26.0.13 && ncp-update-nc 27.1.11 && ncp-update-nc 28.0.14" &&
apt -y clean                                                                                                                   &&
apt -y update                                                                                                                  &&
apt -y upgrade                                                                                                                 &&
apt -y autoremove                                                                                                              &&
poweroff 

Time taken for stage 2: 2358 seconds
Backup time for stage 2: 2951 seconds

Stage 3:

ncp-update                                                                                               &&
systemctl reload apache2                                                                                 &&
mysql nextcloud -e "DROP TABLE IF EXISTS oc_direct_edit_old ; DROP TABLE IF EXISTS oc_dav_cal_proxy_old" &&
cd /tmp                                                                                                  && 
/usr/bin/time -f %e bash -c "ncp-update-nc 29.0.11 && ncp-update-nc 30.0.5"                              &&
poweroff

Time taken for stage 3: 4384 seconds
Backup time for stage 3: 3024 seconds

Next target is probably to have a look at AIO and work out if I want to end up there.

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