Updates between multiple major versions are unsupported

Problem

A “Updates between multiple major versions are unsupported” message is shown during an update/upgrade

Description

As the message is telling you, you have done an unsupported upgrade path. For example:

Original version: 9.0.52
Upgraded version: 11.0.0

In this case you have skipped the 10.0.x upgrade which is unsupported as stated within the documentation.

Solution:

You need to upgrade first to the latest available version of 10.0.x which is currently 10.0.2. For that specific scenario the following is recommended:

  1. Remove all files and folders of your Nextcloud installation folder except /data/ and /config/
  2. Download 9.0.56 from https://nextcloud.com/changelog/
  3. Extract the content of the archive it into your Nextcloud installation folder
  4. Run the update via the webui or the command line tool

Afterwards repeat those steps with 10.0.2 and 11.0.0

4 Likes

On migration from owncloud 10.0.9.5, the updater downloaded automatically Nextcloud version 12.0.10

Unfortunately, occ upgrade failed:

sudo -u www-data ./occ upgrade
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
Exception: Updates between multiple major versions and downgrades are unsupported.
Update failed
Maintenance mode is kept active
Reset log level

1 Like

I am running into the same problem. I upgraded my OC instance to the latest version (10.0.9), then ran the NC automated updater. It proceeded fine, but then when I run occ upgrade I get told that multiple version upgrades are not supported.

This is the version it downloaded. It should be a version that it can upgrade to. If not, why did it download it?

2 Likes

For updating snaps, use snap refresh nextcloud --channel=13/stable (or whatever version you’re on)… Then just keep incrementing the version… when you’re up to latest, use snap refresh nextcloud --channel=stable

2 Likes

Thanks @hatsix, I was stuck on 13 being forced to 15, your solution helped me log in again, many thanks.

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'

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

  app:
    image: nextcloud:15.0
    build:
      context: .
      dockerfile: Dockerfile
    ports:
      - 8084:80
    links:
      - db
    volumes:
      - /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:
https://docs.nextcloud.com/server/latest/admin_manual/configuration_server/config_sample_php_parameters.html#multiple-config-php-file

1 Like

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

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

Hi,

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'

services:
  proxy:
    image: jwilder/nginx-proxy
    container_name: proxy
    ports:
      - 80:80
      - 443:443
    volumes:
      - ./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
    networks:
      - proxy-tier
    restart: always

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

  web:
    image: nginx
    container_name: nextcloud_webserver
    volumes:
      - ./nginx.conf:/etc/nginx/nginx.conf:ro
    links:
      - app
    volumes_from:
      - app
    environment:
      - VIRTUAL_HOST=****
      - VIRTUAL_NETWORK=nginx-proxy
      - VIRTUAL_PORT=80
      - LETSENCRYPT_HOST=****
      - LETSENCRYPT_EMAIL=****
    networks:
      - proxy-tier
    restart: always

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

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

networks:
  proxy-tier:
    external:
      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:
    from
  app:
    image: nextcloud:fpm

to

  app:
    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:
config/config.php
data/
db (for MySQL or MariaDB, /var/lib/mysql)
custom_apps/

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”
wt%??