Accidentally skipped a major version

Nextcloud version (eg, 20.0.5): 26.0.1 → 28.0.0
Operating system and version (eg, Ubuntu 20.04): FreeBSD 14
Apache or nginx version (eg, Apache 2.4.25): nginx 1.24.0
PHP version (eg, 7.4): 8.1.26

The issue you are facing:
I accidentally skipped version 27 by upgrading using the freebsd package system.

Is this the first time you’ve seen this error? (Y/N): Y

Steps to replicate it:

  1. Have v26 installed
  2. Upgrade package to most recent aka v28
  3. Do occ upgrade and realize you’re screwed apparently.

The output of the occ upgrade command says this:
Exception: Updates between multiple major versions and downgrades are unsupported.
Update failed

So, my question is how do I fix this? I do have a backup of the nextcloud folder from the www folder and a dump of the DB, but I’m unclear about how to restore the backup(seems required from that error message, unless installing the package, which upgraded files, didn’t actually upgrade, I’m unclear how that works).
I only have v28 available from the freeBSD packages or v27 from the quarterly branch, but it’s unclear to me what the update process actually is. Does changing the files update or is it only considered an update after occ upgrade is run.
Could I just start an update command to get my files updated to v27 by just doing nothing or copying my nextcloud backup folder over? Do I need to restore the SQL dump too?

Nextcloud obviously knows my data is too old, but it’s unclear if I got screwed by updating the package or not.

It’s late here but a quick thought:

The occ upgrade sanity checking exception probably saved you here (though fortunately it also sounds like you have backups in case needed).

The Updater primarily just updates your code, while the upgrade phase (only triggered after a successful Updater run) focuses on touching your data.

If you can replace the undesired code on disk you’ll be effectively back to whatever version you overwrite the undesired code with (I suggest the exact same version as last connected with your database)… After that you can just trigger an occ upgrade once the on-disk code seems in order- this will trigger the upgrade phase (which, if you’ve rolled back the on-disk code cleanly, will end without any work to do since the database will already be up-to-date).

Then you can proceed with whatever you want to do next - but should have a restored environment in any case.

Updater = application
Upgrade = data

1 Like

And, yes, you could skip - in any case I can think of - immediately to the NC27 code base on-disk as the “rollback” codebase rather than back to the earlier - or exact - NC26 version (since it’s an acceptable version leap).

Then just do the occ upgrade as if nothing ever went wrong. :grin:

(At least that sounds right in my head).

1 Like

you can try with Adding feasibility check for updates before replacing the nextcloud files · Issue #617 · nextcloud/docker · GitHub it helpedmultiple people to fix the problem without restore…

I went directly to NC27 since it would be the same as updating properly since my data wasn’t touched and it worked without issues, thanks.

1 Like

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