you have to find your docker-compose file first. then you have to find something like this:
services:
app:
image: nextcloud:apache
restart: always
according to image: nextcloud:apache
you have to go to check hub.docker.com for the correct tags with version. e.g. Docker 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.
https://github.com/nextcloud/docker/blob/f2489f014216122820d159c1c31081a069461c32/17.0/apache/entrypoint.sh#L45
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.