Update from 24.0.0 to current version with (too new) PHP 8.2 already installed

The Basics

  • Nextcloud Server version:
    • 24.0.0
  • Operating system and version:
    • Debian 12.8
  • Web server and version:
    • Apache 2.4.62-1~deb12u2
  • Reverse proxy and version:
    • N/A
  • PHP version:
    • 8.2.26
  • Is this the first time you’ve seen this error?:
    • Yes
  • When did this problem seem to first start?
    • Unknown
  • Installation method:
    • updater.phar --no-backup
  • Are you using CloudfIare, mod_security, or similar? (Yes / No)
    • No

Summary of the issue you are facing:

I’ve “inherited” a NextCloud instance that seems to have been neglected in the past. The previous owner/admin is not available anymore for asking questions.

Now I’d like to make things right :slight_smile: and upgrade to the current version. I’ve learned that it has to be done version by version. That’s fine. However, I’m already stuck at the first upgrade step from 24.0.0 to 24.0.12 because the installed PHP version is already too new. I’m a bit confused how this old version could have been installed on the incompatible PHP version 8.2.x at all.
According to apt, there a re no PHP 8.1 packages for Debian 12. I would prefer not having to temporarily downgrade PHP, especially with unofficial packages or from “alternative” package sources.
So, I need to find a way to either

  • force the update on a too new PHP version
  • let PHP report a different version than the installed one

Any ideas?

Steps to replicate it (hint: details matter!):

  1. sudo -u www-data php /var/www/html/nextcloud/updater/updater.phar --no-backup

Then I get this error message:

This version of Nextcloud is not compatible with PHP>=8.2.
You are currently running 8.2.26.

Log entries

N/A

Nextcloud

config.php:

<?php
$CONFIG = array (
  'instanceid' => 'xxx',
  'passwordsalt' => 'xxx',
  'secret' => 'xxx',
  'trusted_domains' => 
  array (
    0 => 'xxx',
  ),
  'overwritehost' => 'xxx',
  'overwriteprotocol' => 'https',
  'datadirectory' => '/var/ncdata',
  'dbtype' => 'mysql',
  'version' => '24.0.0.12',
  'overwrite.cli.url' => 'https://nextcloud/',
  'dbname' => 'nextcloud',
  'dbhost' => 'localhost',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => 'ncadmin',
  'dbpassword' => 'xxx',
  'installed' => true,
  'mail_smtpmode' => 'smtp',
  'mail_smtpsecure' => 'ssl',
  'mail_sendmailmode' => 'smtp',
  'mail_from_address' => 'nextcloud',
  'mail_domain' => 'xxx',
  'mail_smtpauthtype' => 'LOGIN',
  'mail_smtphost' => 'xxx',
  'mail_smtpport' => '465',
  'mail_smtpauth' => 1,
  'mail_smtpname' => 'xxx',
  'mail_smtppassword' => 'xxx',
  'maintenance' => true,
);

welcome to the community @Markus-N :handshake:

If you have a spare system capable to take the files and database , you could perform temporary migration to a docker-based setup, perform all the upgrades to 29 or 30 and migrate back to your final system…

see server_migration

Use → the php-updater script ← to downgrade to 8.1 (the highest php-version still supported by Nextcloud 24)

After you updated your nextcloud, you can switch back php without a hasle.

h.t.h.


Much and good luck,
ernolf

1 Like

Hi,
Thanks for the reply. I’ve talked to the users (only 5, as we are a small organization), and we agreed upon starting with a new install.
Everyone saves their files and calendar entries, then we install the newest version, and then upload the stuff again.
This also saves the problem of not knowing about any customizations the previous admin may have done that we need to care about and that may break things if we don’t.