Nextcloud version: 18,19,20
Operating system and version: Debian Buster + Docker
Apache or nginx version: nginx
PHP version: 7.4?
The issue you are facing: After shortly operating my docker nextcloud service with a v20 image after using v18 before, but NOT upgrading, I now cannot start the docker service with a v19 image, as the logs say the data is already v20 and downgrading is not supported.
Can't start Nextcloud because the version of the data (18.104.22.168) is higher than the docker image version (22.214.171.124) and downgrading is not supported. Are you sure you have pulled the newest image version?
Is this the first time you’ve seen this error? (Y/N): Yes
Steps to replicate it:
Create docker nextcloud service running v18
Start that service with nextcloud image v20
disable maintenance mode in config.php
review “upgrade now?” screen and choose to NOT upgrade
start docker service again with nextcloud image v19
observe error saying that data is already v20 format
i faced the same issue only a few weeks ago when updating from version 17 to 18 (accidentally used the nextcloud image 20). Nextcloud can’t be updated between different major versions. Instead you need to update from major version to next major version (18->19->20).
With each version database migrations are required and i guess that’s the reason. Although i don’t understand why not all migrations are executed sequentially. But maybe there are other reasons, too.
So when you start nextcloud with an new version an update is triggered and it fails if the major versions are too far apart. Sadly, nextcloud changes the version.php in the root directory with the new version. You need to start nextcloud with version 20 again, connect to the docker container and change the version in version.php. Additionally make sure that the config.php has the correct version as well, but this shouldn’t have changed.
Start nextcloud with version 18, see if it works, then change to nextcloud version 19 and execute the database migrations via the occ tool for example.
And if that works, try the same approach with version 20.
Thanks Christian for that proposal. I was confident that it would work, but for me unfortunately it didn’t. I ended up with a broken v20 instance. Luckily I have some more or less recent backup of my docker volumes that I can restore do upgrade properly.
I ran into the same issue. Fixed it by first adding the :19 tag to my docker-compose.yml, ran:
Then manually extracted a 19.x tar.bz2 over the app volume. Find this by running:
docker container inspect nextclouddocker_app_1 #(or whatever your nextcloud container name is)
and looking for the volume with the destination of /var/www/html.
Had to do some permission corrections, create the custom_apps folder, and do a
Then run the upgrade:
docker exec -it -u www-data nextclouddocker_app_1 bash -c ‘./occ upgrade’