Updates between multiple major versions are unsupported

I am stuck on upgrading to 16 now. I accidentally upgraded my docker instance from 14 to 16.

This is, how to remove all files, but keep the database in my docker instance:

my docker-compose.yml

version: '3'

    image: mariadb
    restart: always
      - /var/docker-services/nextcloud/volumes/mysql:/var/lib/mysql
      - MYSQL_PASSWORD=*****
      - MYSQL_DATABASE=nextcloud
      - MYSQL_USER=nextcloud

    image: nextcloud:15.0
      context: .
      dockerfile: Dockerfile
      - 8084:80
      - db
      - /var/docker-services/nextcloud/volumes/html:/var/www/html
    restart: always

First I delete all but the config folder and data inside the volume and then I recreate the docker container:

docker-compose stop
cd volumes/html/
mv data config/ ../
rm ./* -Rf
mv ../data/ ../config/ .
cd ../../
docker-compose up -d
docker exec --user www-data nextcvkevde_app_1 php occ maintenance:mode --off

I can understand jumping versions is not supported and probably not a good idea.
What happened to me is that after some time I ran my Ansible script which just installs the latest nextcloud docker image. Now I am stuck with an error message that directed me to this thread.

So far so good, I would now like to follow the correct upgrade path. But as my ansible script also cleaned out the old container, I am just left with files and database. Is there any way to find out the nextcloud database version? I need to know which version to start upgrading with…

Fiddling around some more, I checked config.php. Is it possible that this file stores the nextcloud version in use? Or what does the version field actually mean? (I still believe it would be my input for nextcloud to run, nothing that nextcloud would overwrite?)

Well yes it’s your configuration and by default only the version field is “overwritten” by Nextcloud itself. But e.g. you can also modify the email settings in the admin page and they will update the values to the config.php

What a T"%T%$&/$&§!!!
Obviously my Ansible script pulls config.php from a repository before deploying the Nextcloud container. And now I learn Nextcloud is editing the file.

So whenever I ran my script config.php contained version 15.0.10, and it seems this bugged Nextcloud from 17 onwards to no longer start. I had to modify the script to run not the latest but distinct versions and in parallel edit config.php as well. Meanwhile I am migrated to 17.

Any idea how to handle this in a smarter way?

Set the read only flag in your config:

Thank you for that hint. From reading the comment this would prevent Nextcloud writing the file, and all functions requiring that (e.g. changes on the admin ui) will fail. Sounds good.

But what is this thing about making the file writable for upgrades? After all I want to use my script in case of reinstalls as well as upgrades so it usually installs the latest version - whatever that this and therefore I could not predict when Nextcloud needs to write the file…

So what you could do is:

  • Remove the version from the config.php you copy all the time
  • Copy the config.php to others.config.php instead of config.php

The two configs will then be merged on use. So it would still copy all your configs all the time, while not overwriting the version from the config.php:

1 Like

This sounds very suitable for my purpose. Thank you. :slight_smile:

I am running Ubuntu 18.04.3 LTS on the VM provided by T&M Handson. But the version of nextcloud is old, version T&M Hanson. I ran there update script but it announced failed to upgrade. Server is now in manitenance mode. If I turn it off it shows on the web gui I need to upgrade but then get the error you have stated.

To follow your workaround I have a Question though what/where is my installation folder?
Is it /var/www/nextcloud? If yes I dont have permission to that folder as sudo, so what account is configured to edit its contents.


Please excuse me for not knowing anything about all of this. I’m a total novice.

I rent shared server space that uses Softaculous through CPanel to install things like NextCloud, wordpress, etc. NextCloud was all installed and working fine when I got a notification saying to upgrade. I clicked to have it upgrade and evidently, it attempted to jump from maybe 15 to 17 (I honestly don’t know which was initially on there).

Now, since I use softaculous, I don’t know how or what I should do because I don’t actually run the server and I don’t have SSH access or anything.

I don’t want to mess anything up. I can get to my stuff using the cPanel file manager. If I have to, I was just going to do a fresh install but I don’t know how to migrate the files in or point the new instal to where the old files were or what to do.

Now can’t access NextCloud by going to the site or anytnhing. I’m just afraid of losing my stuff stored in nextcloud.

Any ideas on how I can do the upgrade without losing my data or anything? Or just do a fresh install and then move the files or substitute the old NextCloudData file for the new one?

Again, sorry so vague and ignorant. Any help is much appreciated.

Thank you.

I was upgrading my docker-compose (using nextcloud:fpm image) setup from 16 to 18. I don’t know/remember why I am using fpm tag or what it even means. I probably followed some guide. This might therefore not be directly applicable to others. But I made this write-up hoping that it provides clues to making someone else’s life easier.

My docker-compose.yml
# NextCLoud with MariaDB/MySQL all behind Nginx acting as a Reverse Proxy with SSL Encryption from LetsEcrypt.
# During initial NextCLoud setup, select "Storage & database" --> "Configure the database" --> "MySQL/MariaDB"
# Database user: nextcloud
# Database password: nextcloud
# Database name: nextcloud
# Database host: replace "localhost" with "db" the same name as the data base container name.

version: '2'

    image: jwilder/nginx-proxy
    container_name: proxy
      - 80:80
      - 443:443
      - ./proxy/conf.d:/etc/nginx/conf.d
      - ./proxy/vhost.d:/etc/nginx/vhost.d
      - ./proxy/html:/usr/share/nginx/html
      - ./proxy/certs:/etc/nginx/certs:ro
      - /var/run/docker.sock:/tmp/docker.sock:ro
      - proxy-tier
    restart: always

    image: jrcs/letsencrypt-nginx-proxy-companion
    container_name: letsencrypt-companion
      - proxy
      - /var/run/docker.sock:/var/run/docker.sock:ro
      - ./proxy/certs:/etc/nginx/certs:rw
    restart: always

    image: nginx
    container_name: nextcloud_webserver
      - ./nginx.conf:/etc/nginx/nginx.conf:ro
      - app
      - app
      - VIRTUAL_HOST=****
      - VIRTUAL_NETWORK=nginx-proxy
      - VIRTUAL_PORT=80
      - proxy-tier
    restart: always

    image: nextcloud:fpm
    container_name: nextcloud_fpm
      - db
      - ./nextcloud/apps:/var/www/html/apps
      - ./nextcloud/config:/var/www/html/config
      - ./nextcloud/data:/var/www/html/data
      - proxy-tier
    restart: always

    image: mariadb
    container_name: db
      - ./nextcloud/db:/var/lib/mysql
      - MYSQL_DATABASE=nextcloud
      - MYSQL_USER=****
      - MYSQL_PASSWORD=****
      - proxy-tier
    restart: always

      name: nginx-proxy
  1. ssh to the server

  2. Make backup of NC (NextCloud) data:

sudo rsync -a ~/nextcloud ~/nextcloud.BAK
  1. Turn on maintenance mode:
docker exec -u www-data nextcloud_fpm php occ maintenance:mode --on
  1. Change in docker-compose.yml:
    image: nextcloud:fpm


    image: nextcloud:17-fpm

I got the tag 17-fpm searching from here.

  1. Update the docker images:
docker-compose down
docker-compose pull
docker-compose up -d
  1. Check that the version is correct (17 in my case):
docker exec -u www-data nextcloud_fpm php occ status
  1. Upgrade NC:
docker exec -u www-data nextcloud_fpm php occ upgrade
  1. Repeat steps 4-7 for each intermediary major version of NC. And then one more time for the latest version (18 in my case) but in step 4 I change it back to nextcloud:fpm (the latest version).

  2. Turn off maintenance mode:

docker exec -u www-data nextcloud_fpm php occ maintenance:mode --off

Hey @nickvergessen

I am using NextCloud on Unraid for sometime now and trying to update my version of NextCloud but having issues. I’m currently on 16.0.8 trying to update to 17.0.4. Once I select the “Open updater” option I get a white page with the writing “Step 3 is currently in process. Please reload this page later.” It was been stuck like that for almost a month now.

I’ve tried to update manually via the command line using the docker terminal. I get stuck at the command:

sudo -u abc php7 /config/www/nextcloud/occ upgrade

It returns:

NextCloud or one of the apps require upgrade - only a limited number of commands are available
You may use your browser or the occ upgrade command to do the upgrade
Set log level to debug
Turned on maintenance mode
Exception: Updates between multiple major versions and downgrades are unsupported.
Update failed
Maintenance mode is kept active
Reset log level

Also, when trying to launch the NextCloud docker I get an Internal Server Error. I can provide logs or whatever is needed.

Any assistance is greatly appreciated.

I have found that separating the following folders to a local volume helps the upgrade process a lot:
db (for MySQL or MariaDB, /var/lib/mysql)

With these folders on separate volumes from the container upgrades have been greatly simplified.

1 Like

I allowed nethserver to proceed with a core upgrade - now nextcloud is at 20.0.1 as part of that process
However nextcloud 1. still brings up the update page
2. nextcloud is already at 20.0.1 yet brings up an update page for 20.0.1 then
fails with “Updates between multiple major versions are unsupported”

Most likely you previously used a Nextcloud version lower than v19 if the given error is displayed and your provider installed a new version without following the Nextcloud update rules… Please check the version number shown in the Nextcloud configuration file:

# grep "'version'" <path-to-your-nextcloud-config-directory>/config.php
1 Like

no provider …

was prompted by a pop-up within nethserver.

Simply clicked on the upgrade button.

If that’s what broke my server then Nextcloud and Nethserver need to get their act together.

I’m not that technical … so not visiting any command line

I had a working server - clicked on an upgrade button and now I can’t access my files.

That sure sounds like POS design to me

So without a valid feedback the root cause of the problem cannot be analyzed any further. So my recommendation is to get in touch with the Nethserver support team and ask them to fix the issue.


not the problem of NC, of course. Go and get support from Nethserver, they seem to be responsible after what I read from you.

And as you won’t provide any valid feedback nor are you willing to work with commandline, I’m closing this thread…

  1. for being old and solved (NC doesn’t support skipping of major versions)
  2. for lacking interest in getting your problems fixed
  3. for using bad assumptions on a user (was reported and got “fixed”)