Upgrade fails; container won't start

Hi all,

I have Nextcloud AOI running on my Synology NAS. It is version 27. However, I tried to upgrade to the latest version. This took quite some time(showing "Upgrading…93,25%), and eventually it fails. The error message portainer shows is:

Initializing nextcloud 30.0.0.14 ...

Can’t start Nextcloud because upgrading from 27.0.2.1 to 30.0.0.14 is not supported.

It is only possible to upgrade one major version at a time. For example, if you want to upgrade from version 14 to 16, you will have to upgrade from version 14 to 15, then from 15 to 16.

Additional info:
The Nextcloud container runs as a Portainer stack, along with the redis, db and cron container. These seem to run just fine.

How can I solve this ? Should I just try to reinstall the nextcloud container with version 27 and than upgrade to version 28, 29, and 30 ?

Cheers,
Andy

Are you sure this is AIO? This looks like the micro-services image.

Can you post your Compose file?

I suspect you don’t have a version tag on your image reference. You can’t skip major versions.

To be honest, I don’t know. I used a setup from the mariushosting site. The compose file I used looks like this:

services: mariadb: container_name: Nextcloud-DB image: mariadb:11.4-noble #LTS Long Time Support Until May 29, 2029. security_opt: - no-new-privileges:false command: --transaction-isolation=READ-COMMITTED --binlog-format=ROW --innodb-read-only-compressed=OFF volumes: - /volume1/docker/nextcloud/db:/var/lib/mysql:rw - /volume1/docker/nextcloud/db:/etc/mysql/conf.d:rw environment: - MYSQL_ROOT_PASSWORD=rootpass - MYSQL_PASSWORD=mysqlpass - MYSQL_DATABASE=nextcloud - MYSQL_USER=nextcloud - TZ=Europe/Bucharest restart: on-failure:5

redis:
image: redis
container_name: Nextcloud-REDIS
hostname: nextcloudredis
user: 1026:100
healthcheck:
test: [“CMD-SHELL”, “redis-cli ping || exit 1”]
volumes:
- /volume1/docker/nextcloud/redis:/data:rw
environment:
TZ: Europe/Bucharest
restart: on-failure:5

nextcloud:
container_name: Nextcloud
ports:
- 8082:80
depends_on:
mariadb:
condition: service_started
redis:
condition: service_healthy
environment:
- REDIS_HOST=nextcloudredis
- NEXTCLOUD_ADMIN_USER=marius
- NEXTCLOUD_ADMIN_PASSWORD=adminpass
- NEXTCLOUD_TRUSTED_DOMAINS=nextcloud.yourname.synology.me 192.168.1.18
- TRUSTED_PROXIES=192.168.1.18
- OVERWRITEHOST=nextcloud.yourname.synology.me
- OVERWRITEPROTOCOL=https
- MYSQL_PASSWORD=mariushosting
- MYSQL_DATABASE=nextcloud
- MYSQL_USER=nextcloud
- MYSQL_HOST=mariadb
healthcheck:
test: curl -f http://localhost:80/ || exit 1
volumes:
- /volume1/docker/nextcloud/html:/var/www/html:rw
- /volume1/docker/nextcloud/custom_apps:/var/www/html/custom_apps:rw
- /volume1/docker/nextcloud/config:/var/www/html/config:rw
- /volume1/docker/nextcloud/data:/var/www/html/data:rw
- /volume1/docker/nextcloud/themes:/var/www/html/themes:rw
image: nextcloud
restart: on-failure:5

cron:
image: nextcloud:apache
container_name: Nextcloud-CRON
restart: always
volumes:
- /volume1/docker/nextcloud/config:/var/www/html/config:rw
- /volume1/docker/nextcloud/html:/var/www/html:rw
- /volume1/docker/nextcloud/custom_apps:/var/www/html/custom_apps:rw
- /volume1/docker/nextcloud/data:/var/www/html/data:rw
entrypoint: /cron.sh
depends_on:
mariadb:
condition: service_started
redis:
condition: service_started

Yeah this is the micro-services image not AIO (which is fine, just different beasts).

Append a tag to the image reference for the major version. Currently you’re on 27. I would (ideally) bump up to the latest 27 then bump your tag to the next higher major version (28). Up to you how far you take it after that. :slight_smile:

So change the reference to:

image: nextcloud:27-apache

Do the same for the cron container, which should match your main nextcloud container at all times:

So change: image: nextcloud:apache for the cron container to image: nextcloud:27-apache.

Then do do this to get your containers upgraded to the latest 27:

docker compose pull
docker compose up -d

You can monitor the logs to make sure things upgrade to the last maintenance release that was published of 27.

Then you can bump the tags up to the ones for 28:

image: nextcloud:28-apache

Again, do cron too at the same time.

References:

Thanks for the guidelines. Need to figure out how to do that in Portainer.

cheers,
Andy Kannberg

It was actually quite easy. The compose file was available in Portainer. Changed the version numbers as described and after the update, Nextcloud works again. Now upgrading to 28 - 29 - 30.

Thanks for the great tip !

Cheers,
Andy

EDIT: Currently running on version 30. Thanks for the support. This community rocks !

1 Like

This topic was automatically closed 8 days after the last reply. New replies are no longer allowed.