Upgrade to Debian 12 Bookworm

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.

That worked for me. Make a backup. Ok. i have not made a backup. But was also only a test system on an old 32-bit computer.

I am since months on a box with Bullseye with Nextcloud 25. It never offered to update to Nextcloud 26. So I doubt that this will work for @chojin

1 Like

Indeed update to Nextcloud 26 should never be proposed on Debian 11, as the requirements will never be met as is. I read that someone had it proposed but I do not even see how that could be, since Bullseye has PHP 7.4.33.

Unfortunately, I am no longer quite sure. Maybe it was not displayed either. But the updater worked. Maybe you can - if the GUI doesn’t offer an update - still check under Debian Bullseye with the occ-command if a Nextcloud update is offered at all theoretically. But I would do it only after the dist upgrade to Debian Bookworm.

Ideally, the updater would check the PHP version and display an appropriate message if the existing PHP version is not supported. I don’t know, maybe it actually does that…

Checking the OS version wouldn’t make much sense though, because you could have installed a newer PHP version via third party repos.

So after careful considerations, I decided to attempt the full-upgrade to Debian 12 and running the cli updater. It worked wonderfully, without even having to hack “versioncheck.php”.

To anyone stumbling upon this thread, here is the exact steps I did (your results may vary obviously):
1/ Backup!
2/ Backup!
3/ Backup!
4/ Ensure your Debian 11 is current:

apt update

then

apt dist-upgrade

5/ Reboot if necessary
6/ Ensure your Nextcloud is current: 25.0.12 and that no warning (besides the obvious 7.4.33) is shown on the self tests in the admin panel
7/ Edit “/etc/apt/sources/sources.list”, replacing “bullseye” by “bookworm” everywhere. Here is mine:
image
8/ Do a first upgrade, without new packages:

apt update

then

apt upgrade --without-new-pkgs

Answer “Yes” to automatically restart services

9/ Immediately after, do a full upgrade:

apt full-upgrade

Answer “Yes” to automatically restart services

10/ reboot

11/ If you had apcu cli enabled in 7.4, this is not automatically enabled in 8.2, so edit the ini file accordingly

vi /etc/php/8.2/mods-available/apcu.ini

and add

apc.enable_cli = 1

12/ run the cli updater (replace “/var/www/nextcloud” with your nextcloud root folder)

sudo -u www-data php --define apc.enable_cli=1 /var/www/nextcloud/updater/updater.phar

It should offer the jump from 25.0.12 to 26.0.7:

13/ After the upgrade is successful (hopefully), you will have to put your old 7.4 php.ini settings back in the 8.2 php.ini file (I just had to put 512M Memory limit back)

14/ You will also have to add missing indices as usual:

cd /var/www/nextcloud/

sudo -u www-data php occ db:add-missing-indices

This shows that the updater.phar really is its own thing, and that it is now way more reassuring not having to tinker with ANY file.

I hope this can help people.

Kind regards.

8 Likes

Thanks for your detailed steps. This worked for me too.

1 Like

That’s great to hear. I’m glad it helped you :slight_smile:

Did you find a solution to this?

chojin, your post was very helpful, in my case I needed to add php8.2 in the list of apache2 modules, after upgrade to Debian 12, using a2enmod command.

1 Like

Thanks @chojin,

the updater worked and updated to version 25.0.13
(Current version is 25.0.13)

Still I’m stuck as I get this error message:
/var/www/html/nextcloud# ./occ upgrade
This version of Nextcloud is not compatible with PHP>=8.2.
You are currently running 8.2.18.

same when I try to fix the indicies:
:/var/www/html/nextcloud# sudo -u www-data php occ db:add-missing-indices
This version of Nextcloud is not compatible with PHP>=8.2.
You are currently running 8.2.18.root@homeserv:

Any clou how I could now trigger the update to NC26?
Thanks in advance!

Ringel

Hello,

I suggest you run the updater.phar command, as stated in my step 12 (I edited the path accordingly):

sudo -u www-data php --define apc.enable_cli=1 /var/www/html/nextcloud/updater/updater.phar

I guess updater.phar will work, whereas occ is embedded (and “stuck”) to the PHP version that is compatible with the web UI.