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.
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.