Questions regarding NC updates with docker (compose)

Hello guys! I hope this is correct thread to ask this question but i’m new here and i haven’t use nextcloud server very much after that when i get the server started. But now i want update the server to newest stable version and what i need to know before i can do it?

I’m running my server in docker-compose (if i remember correctly) and version what i use now is 13.x.x. Docker is running in ubuntu machine and there is 3 hdd set up to raid5.

I read some instructions from nextcloud docker documentation and there was some note that versions must upgrade one by one. But i’m not sure doe’s this note affect if server is running in docker-compose. So do i need do anything else than say:
$ docker-compose pull
$ docker-compose up -d

And if i can remember correctly i set in config.php file version to 13 but can’t remember why. So do i need change that to 14 and say those commands again and then change to 15 and so on. And when i get latest version should i change version to “latest”? Or can i do it that way i set version straight to “latest” and say those two commands and docker handle those versions correctly?

Thank you for your answers!

Hello and welcome to the Forum.

For such complex questions and also for questions and problems which are rather specific to your environment, please open new topics.
I moved your question to a new topic now.

And maybe @Reiner_Nippes can help you here. He is our docker compose expert :slight_smile:

Thank you very much! I post my configuration files here when i get back to home.

you have to find your docker-compose file first. then you have to find something like this:

    image: nextcloud:apache
    restart: always

according to image: nextcloud:apacheyou have to go to check for the correct tags with version. e.g. that would be 13-apache, 14-apache, … 17-apache

then it’s more or less:

docker stop nextcloud
docker rm nextcloud
vim docker-compose # change image: nextcloud:apache -> image: nextcloud:<version>-apache
docker-compose up -d 

imho docker-compose pull is not necessary. will be done by docker-compose up.
you repeat this from 13 -> 14 -> 15 -> 16 -> 17 -> latest. you start with 13 because we don’t know if you have the latest version of 13.

pro tip: before you start make a backup. create a new machine (virtual box, cloud, old hw), install docker/docker-compose on this machine, restore your data from the original machine and do the upgrades here. (as an exercise/proof of concept or replacement)

data migration/backup with docker: if you have the old docker-compose file find the volume definitions and find this files on your host filesystem. (docker inspect <container-id> will be helpful if you don’t have the docker-compose file anymore. it will tell you all details about your container so you could restore the compose file. if you find the files (nnextcloud data, config and database) you can copy them to a save place or the new machine.

nextcloud is doing this for you. if you want to break your system. change the value manually. my advice: don’t do it.

docker will pull the latest image version. on startup a nextcloud script will check the installed version against the version in the container. the installed version is in a volume on your host. or should be. there should be a volume mapped to /var/www/html in the container to get the installation persistent between image updates.

and i’m pretty sure that you’ll get an error message from nextcloud that you can’t update from 13 to 17. (if you are brave edit the config.php version and change it to 16 and find out what happens.)

and i’m not the docker-compose guy. i’m the ansible playbook guy.

if you want to save some typing while you setup your backup/migration server use my playbook.

the image version are defined here:

the playbook is idempotent. you can run it multiple time and to the update step by step.