What the message looks like
Nextcloud or one of the apps require upgrade - only a limited number of operations are allowed
Updates between multiple major versions and downgrades are unsupported.
Update failedCommon causes
- You tried to jump over a major release, for example from version N straight to N+2.
- The code is older than the data: a file backup or an old Docker image tag was restored, but the database and
config.phpbelong to a newer version. - The wrong code folder is live, for example a symlink or web root still pointing to an old copy after an update.
- An update was interrupted halfway, so code and database now disagree.
Check
- Version of the code on disk
grep OC_VersionString /var/www/nextcloud/version.php - Version Nextcloud has recorded
grep "'version'" /var/www/nextcloud/config/config.php - What does the CLI say?
- Where does the web root point?
readlink -f /var/www/nextcloud
Fix
- Compare the two versions. If the code is older than the recorded one, put the matching newer code back, or restore a database backup that was taken together with this code.
- If you skipped a major, install the last release of the next major first, run
sudo -u www-data php occ upgrade, and repeat one major at a time until you reach the target. - Before each step, make a backup of code,
config.php, data and database, and disable apps that do not support the next version withocc app:disable. - Do not edit
'version'inconfig.phpto get past the check. That can corrupt the database schema. - After the last step, leave maintenance mode with
occ maintenance:mode --offand check the admin overview.
Typical scenario
A Docker setup uses image: nextcloud:latest. After months of standstill, docker compose pull jumps two major versions at once, and the container aborts at start with Updates between multiple major versions and downgrades are unsupported. The data is untouched, only the code is too new for the state recorded in config.php. First check: which version is in config.php, and which one does the image ship?
FAQ
Can I downgrade Nextcloud?
Not by swapping the code. A downgrade is only safe by restoring a full backup (code, config and database) from the same moment.
How do I know which majors I must install?
Check the release notes and upgrade path of the official documentation for your starting version, then go through each major in order, always taking the latest minor release of it.
Why should I not use latest in Docker?
With latest the time of the pull decides the version, and several major versions can pile up. Use a fixed tag such as nextcloud:28 and raise it deliberately by one major version per step, with a completed update in between.
May I skip patch and minor versions?
Within the same major version, yes: you can jump straight to the current release of that line. Only skipping whole major versions is forbidden. The way from 26 to 28 therefore goes through the last 27 release.
What if the too-new image was already started?
Stop it and use the image that matches the version in config.php, or the next higher major version. A downgrade is not supported. If the database was already partly migrated, only restoring a backup of database and configuration helps.