Upgrade MariaDB Enterprise Server from 10.3.X to 10.3.Y on Ubuntu 20.04 LTS

These instructions detail a minor release upgrade with MariaDB Enterprise Server 10.3 on Ubuntu 20.04 LTS.

A minor release upgrade is a change from an earlier release of MariaDB Enterprise Server 10.3 to a later release in the same release series.

For example, it would be a minor release upgrade to upgrade from MariaDB Enterprise Server 10.3.23-7 to MariaDB Enterprise Server 10.3.24-8.

Data Backup

Occasionally, issues can be encountered during upgrades. These issues can even potentially corrupt the database's data files, preventing you from easily reverting to the old installation. Therefore, it is generally best to perform a backup prior to upgrading. If an issue is encountered during the upgrade, you can use the backup to restore your MariaDB Server database to the old version. If the upgrade finishes without issue, then the backup can be deleted.

The instructions below show how to perform a backup using MariaDB Backup. For more information about backing up and restoring the database, please see the Recovery Guide.

  1. Take a full backup:

    $ sudo mariabackup --backup \
          --user=mariabackup_user \
          --password=mariabackup_passwd \
          --target-dir=/data/backup/preupgrade_backup
    

    Confirm successful completion of the backup operation.

  2. The backup must be prepared:

    $ sudo mariabackup --prepare \
          --target-dir=/data/backup/preupgrade_backup
    

    Confirm successful completion of the prepare operation.

  3. Backups should be tested before they are trusted.

Stop the MariaDB Server Process

Before the new version can be installed, we first need to stop the current MariaDB Server process.

  1. Stop the server process using the systemctl command:

    $ sudo systemctl stop mariadb
    

Install the New Version

MariaDB Corporation provides a APT package repository for Ubuntu 20.04 LTS.

Install via APT (Debian/Ubuntu)

  1. Retrieve your Customer Download Token at https://customers.mariadb.com/downloads/token/ and substitute for customer_download_token in the following directions.

  2. Configure the APT package repository.

    To configure APT package repositories:

    $ sudo apt install wget
    
    $ wget https://dlm.mariadb.com/enterprise-release-helpers/mariadb_es_repo_setup
    
    $ echo "eeebe9e08dffb8a4e820cc0f673afe437621060129169ea3db0790eb649dbe9b  mariadb_es_repo_setup" \
        | sha256sum -c -
    
    $ chmod +x mariadb_es_repo_setup
    
    $ sudo ./mariadb_es_repo_setup --token="customer_download_token" --apply \
       --mariadb-server-version="10.3"
    
    $ sudo apt update
    
  3. Update MariaDB Enterprise Server and package dependencies:

    $ sudo apt install --only-upgrade "mariadb-*" "galera*"
    

Starting the Server

MariaDB Enterprise Server includes configuration to start, stop, restart, enable/disable on boot, and check the status of the Server using the operating system default process management system.

Ubuntu 20.04 LTS uses systemd. You can manage the Server process using the systemctl command:

Operation

Command

Start

sudo systemctl start mariadb

Stop

sudo systemctl stop mariadb

Restart

sudo systemctl restart mariadb

Enable during startup

sudo systemctl enable mariadb

Disable during startup

sudo systemctl disable mariadb

Status

sudo systemctl status mariadb

Upgrading the Data Directory

MariaDB Enterprise Server 10.3 ships with the mysql_upgrade utility which can be used to identify and correct compatibility issues in the new version. After you upgrade your Server and start the server process, run this utility to upgrade the data directory:

$ sudo mysql_upgrade

Testing

When MariaDB Enterprise Server is up and running on your system, you should test that it is working and there weren't any issues during startup.

  1. Connect to the server using MariaDB Client using the root@localhost user account:

    $ sudo mysql
    Welcome to the MariaDB monitor.  Commands end with ; or \g.
    Your MariaDB connection id is 9
    Server version: 10.3.24-8-MariaDB-Enterprise MariaDB Enterprise Server
    
    Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
    
    Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
    
    MariaDB [(none)]>
    
  2. You can also verify the server version by checking the value of the version system variable with the SHOW GLOBAL STATUS statement:

    MariaDB [(none)]> SHOW GLOBAL VARIABLES LIKE 'version';
    +---------------+------------------------------+
    | Variable_name | Value                        |
    +---------------+------------------------------+
    | version       | 10.3.24-8-MariaDB-Enterprise |
    +---------------+------------------------------+
    1 row in set (0.001 sec)
    
  3. You can also verify the server version by calling the VERSION() function:

    MariaDB [(none)]> SELECT VERSION();
    +------------------------------+
    | VERSION()                    |
    +------------------------------+
    | 10.3.24-8-MariaDB-Enterprise |
    +------------------------------+
    1 row in set (0.000 sec)