Upgrading ownCloud installed in a Docker Container

When a new version of ownCloud gets released, you should update your instance. To do so, follow these simple steps:

  1. Go to your docker directory where your .yaml and .env files exist.
  2. Put ownCloud into maintenance mode with the following command:

    docker-compose exec owncloud occ maintenance:mode --on
  3. Create a backup of the database in case something goes wrong during the upgrade process, using the following command:

    docker-compose exec mariadb \

    /usr/bin/mysqldump \
    -u root \
    --password=owncloud \
    --single-transaction \
    owncloud > owncloud_$(date +%Y%m%d).sql

    You need to adjust the password and database name if you have changed it in your deployment.
  4. Shutdown the containers:

    docker-compose down
  5. Update the version number of ownCloud in your .env file. You can use sed for it, as in the following example:

    Make sure that you adjust the example to match your installation.

    sed -i \
    's/^OWNCLOUD_VERSION=.*$/OWNCLOUD_VERSION=10.13.3/' .env
  6. View the file to ensure the change has been implemented:

    cat .env
  7. Start your docker instance again.

    docker-compose up -d

    Now you should have the current ownCloud running with docker-compose. Note that the container will automatically run occ upgrade when starting up. If you notice the container starting over and over again, you can check the update log with the following command:

    docker-compose logs --timestamp owncloud
  8. If all went well, end maintenance mode:

    docker-compose exec owncloud occ maintenance:mode --off

This is a copy of the below page:
https://doc.owncloud.com/server/10.13/admin_manual/installation/docker/#upgrading-owncloud-on-docker


Tags:

Comments are closed.