Upgrade to Debian 12 Bookworm

Yes, you need to first install php8 (e.g. upgrade debian to bookworm), and then Nextcloud can be updated (but not from the GUI because it version 25 does not support php8 :frowning:

I did it with “sudo -u www-data occ upgrade” and it worked.

This does not work for me with the error message identical to the one displayed on the home page: “This version of Nextcloud is not compatible with PHP>=8.2.
You are currently running 8.2.7.”

For updates you have to do 2 things:

  • get and unpack new code files (php updater/updater.phar)
  • update your setup environment (config, db) to the new version (php occ upgrade)

The first step is done on the old code base (NC 25) and the second in the new code base (NC 26). The first step can be carried out manually: Delete old code (all files, except the config/ and data/ folder), download new code (Nextcloud server changelog) and put the files in your folder. Adjust the permissions and then you can run the occ upgrade command. It’s more detailed in the documentation.

I had the same problem. for me the easiest solution was:

  • first update to debian bookworm
  • then in the nextcloud directory change the file lib/versioncheck.php
    There should be a line similar to:

if (PHP_VERSION_ID >= 80100) {

change it to

if (PHP_VERSION_ID >= 80300) {

then use the cli updater (maybe also the web one would work)

2 Likes

That upgrade should actually never be offered when using PHP 7.4. At least whenever I tested it, it was not, reasonably, matching also @mlsxlist’s experience. I have no idea why it did show up in your case. Are you absolutely sure that you ran Nextcloud with PHP 7.4 before, i.e. that there was no PHP 8.x CLI used for update checks or similar? As you wrote “e.g. PHP 8.2” while Bookworm ships exactly only PHP 8.2, it sounds like you generally work with other PHP versions/builds not natively provided by the Debian package repository.

The CLI updater does not invoke the versioncheck.php, and the update check can offer NC26 despite PHP 7.4, then it is actually a nice/cleaner method indeed.

I used this guide and it worked perfectly.

Yes. Shows new version on php 7.4 and updater.phar works. No other Debian source.

That is exactly what I did. I upgraded Debian to Bookworm and then use the CLI to upgrade NC25 to 26 and it worked fine. Except in my case I was using non-standard HTTPS port which I had to fix manually.

Bookworm upgrade also bumped up the PHP to version 8.2 which works fine with NC26.

I am running NC 26 on PHP 8.2 right now.

@vasyugan
Me as well, but i took a rather bumpy way. My old machine (i386) crashed rather hard (disk failure) and all i came up with was the “move server” routine as outlined in

https://docs.nextcloud.com/server/latest/admin_manual/maintenance/migrating.html

which allowd me to move my data and database. ( I only had file system access after crash.)

Maybe this is a solution for people without direct upgrade path.
TL;DR: I upgraded from Debian 10 (buster) to Debian 12 (bookworm) and from i386 to amd64 without data loss. I wouldn’t call it a pain in the ass, but it’s not for the fainthearted. I am rather experienced user of server services, but no professional after all.

i386 is unsupported from NC 26 on, AFAIK. So I guess you were running an earlier version that does not support PHP 8.2 yet?

That’s right, i forgot! The NC version was 25.0.3 or something like this. PHP7.3 was installed.

I successfully upgraded my Debian 11 installation to 12. I did use PHP 8.1 from sury.org, which should be removed before upgrading Debian 12. Nextcloud 26 was running without problems in Bullseye and Bookworm.

Next day Nextcloud offers the automatic update to NC27, which was done without problems. Except one message, NC27 reports an missing transaction database. Configuration of PHP 8.2 is identical to Bullseye 8.1 and NC26, and NC26 doesn’t complain about this setting. I can’t fix this setting, and adding Redis with the correct settings from NC manual causes an critical error, NC27 couldn’t be accessed anymore.
I’ll live with the transaction message, use only APCU and wait for NC 27.0.1.

Updating Nextcloud and Debian concurrently resulted in a complete clusterfck.

I had to switch to php 8.1 manually. With php 8.2 login and some apps work, but “files” and syncing from clients does not, although in the admin page, nextcloud 27 shows me the famous green tickmark.

I compared the php 8.1 and 8.2 configurations via phpinfo() meticulously and saw now relevant differences. By the way, all other web pages on that server work well with php 8.2.

With each update I hope that whatever the issue that apparently only nextcloud has with php 8.2 gets fixed.

1 Like

I too have up-to-date Debian 11, php 7.4, and want to upgrade (non-snap, non-docker) NC 25.0.10 to NC 26.0.5 (then later onward to 27).

After following the official manual upgrading guide:
https://docs.nextcloud.com/server/latest/admin_manual/maintenance/manual_upgrade.html
…it’s a nightmare, because the totally unhelpful following error message comes, whenever trying to use occ (as in “sudo -u www-data php occ”):

Composer autoloader not found, unable to continue. Check the folder "3rdparty". Running "git submodule update --init" will initialize the git submodule that handles the subfolder "3rdparty"

Even trying to do a fresh install of NC27.0.2 on the current Debian 12 (all php dependencies here are met, via stock php 8.2 debian packages), following these directions:
https://docs.nextcloud.com/server/latest/admin_manual/installation/command_line_installation.html
…meets the same “Composer autoloader” error message above, even after installing the following debian packages:

  • composer 2.5.5-1
  • php-composer-ca-bundle 1.3.5-1
  • php-composer-class-map-generator 1.0.0-2
  • php-composer-metadata-minifier 1.0.0-2
  • php-composer-pcre 3.1.0-1
  • php-composer-semver 3.3.2-1
  • php-composer-spdx-licenses 1.5.7-1
  • php-composer-xdebug-handler 3.0.3-2

Maybe you can use some parts of this installation guide.

Your guide indeed contained some juicy tuning parameters for php-fpm’s php.ini (/etc/php/8.2/fpm/php.ini). So thanks for that.

But I still end up with that pesky:
Composer autoloader not found, unable to continue. Check the folder "3rdparty". Running "git submodule update --init" will initialize the git submodule that handles the subfolder "3rdparty".

…error message all the same; it’s just that I see it in my web browser now, as opposed to on the command line, using the “occ” command.

Is it possible that you have downloaded and used the source archive from the GitHub repository instead of the installer from here? Because that would explain the error message.

And did you try to run the command the error message is suggesting?

1 Like

Much appreciated! Yes, that was the mistake I made. Thanks for the great link to the fluff-free download page. :blush:

1 Like

Hello,

I am now in that infamous Nextcloud 25 / Debian 11 situation.

I would like to update to Nextcloud 26 but also avoid using external repositories, for compliance reasons. So Debian 12 seems the way to go.

I read here and there that editing “versioncheck.php” would allow me to upgrade to Nextcloud 26 after doing a full upgrade from Debian 11 to Debian 12.

It sounds really simple, would it be the recommended way in my use case? Are there things that could go wrong down the line, appearing in the following weeks/months ? Or is that bulletproof?

Kind regards.