Warning: Update Debian bullseye to bookworm results in impossible Nextcloud update from 25.x.x to 26.x.x

Hi everyone,

Just a warning for all who are running debian bullseye with nextcloud within debian environment.

If you update Debian to bookworm php will be updated to php8.2.
Since nextcloud 25.x.x does not support php8.2 you cannot update natively within debian environment.

As a solution I suggest (and did) update php7.4 to php8.1 using the

( sudo add-apt-repository ppa:ondrej/php)
after that update nextcloud from 25.x.x to 26.0.1 via command line since for some reasons the web page did not work, but that was not necessary.
After that remove the php repostory and start the normal upgrade progress to debian bookworm.

Hi @florom ,

unfortunately I did read this only now, after updating to bookworm…
Something I really didn’t expect to happen…
Any idea what to do now?
Now I’m with bookworm, nextcloud 25.x.x and php8.2.
I would be really sad if I destroy my configuration and setting by screwing this up…
Or anyone else who solved this issue already?
Thanks!
Ringel

First, do a backup so you can always get back to the situation you are currently in (even if you think it is not ideal, it might get worse).
For php 8.2, you need at least Nextcloud 26, since it is the next major version, you can try to upgrade directly to Nextcloud 26 via manual update (because then you replace the code and everything, so you can run NC26-code directly.

So you have the backup.

Keep the data/ and the config/ folder. Delete the rest, these are just code files. Download the latest release of the NC 26 branch: Nextcloud server changelog and extract the code to your folder (here also the official docs, if you need to fix permissions etc: Upgrade manually — Nextcloud latest Administration Manual latest documentation).
Then you should be able to run the occ update command:
sudo -u www-data php occ update

This should carry out all the modification required for NC 26 and then you should be good. When you switch to a new php version, sometimes it can happen that not all required php modules are installed (should give you warnings and errors, either on the command line for the occ command, or in the error logs later).