Database Upgrade

Introduction

Usually, when upgrading a database, follow the guides the vendor provides. You may also take a look at the Install a Database section for general notes.

This document supports an upgrade in case there are prerequisites and/or special steps to be taken to upgrade to a particular database version.

Upgrading to MariaDB 10.6+

ownCloud runs fine when using a MariaDB version lower than 10.6. You can upgrade ownCloud as usual without special considerations regarding the database.

When planning to upgrade to MariaDB 10.6, some prerequisites have to be met and upgrade steps have to be taken.

This is mostly due to the fact that, unlike before, in MariaDB 10.6 tables of the COMPRESSED row format are read-only by default. For more information see the InnoDB COMPRESSED Row Format document.

This process only needs to be carried out once.

Overview

  1. You must have upgraded your ownCloud installation to version 10.9 or above. To do so, follow the Manual ownCloud Upgrade guide.

  2. Backup your ownCloud installation, especially the database to rollback in case of issues. To do so, follow the Backing up ownCloud guide.

  3. Prepare the database for the upgrade with an occ command.

  4. Follow the respective Upgrading MariaDB guide to upgrade MariaDB.

Detailed Upgrade Steps

  1. If not already done, upgrade the ownCloud installation to version 10.9 or above.

  2. Set ownCloud in maintenance mode

    sudo -u www-data ./occ maintenance:mode --on
  3. Prevent browser access

    Stop your web server to prevent users from trying to access ownCloud via the web. As an alternative, you can stop serving the virtual host for ownCloud.

    Stop the web server:

    sudo service apache2 stop
  4. Run an occ command to prepare the database for the upgrade

    sudo -u www-data ./occ db:restore-default-row-format
  5. Upgrade MariaDB to version 10.6+

    Follow the instructions in the respective Upgrading MariaDB guide to upgrade MariaDB.
    If required, run the mysql_upgrade command when using a binary installation or as example

    docker-compose exec owncloud mysql_upgrade -uroot -p

    when using a dockerized environment as part of the upgrade procedure.

  6. Set ownCloud back to normal operation mode:

    sudo -u www-data ./occ maintenance:mode --off
  7. Enable browser access
    Start your web server, Alternatively, enable the virtual host serving ownCloud again:

    sudo service apache2 start