Database Upgrade

Introduction

Usually, when upgrading a database, follow the guides the vendor provides.

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

    docker compose exec owncloud occ maintenance:mode --on
  3. Prevent browser access:
    Configure your web proxy server to prevent users from accessing ownCloud via the web.

  4. Run an occ command to prepare the database for the upgrade

    docker compose exec owncloud 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 compose setup including MySQL.

    docker compose exec owncloud mysql_upgrade -uroot -p
  6. Set ownCloud back to normal operation mode:

    docker compose exec owncloud occ maintenance:mode --off
  7. Enable browser access
    Configure your web proxy server to enable users to access ownCloud via the web.