Upgrade from MariaDB Community Server to MariaDB Enterprise Server 10.5

These instructions detail the upgrade from MariaDB Community Server to MariaDB Enterprise Server 10.5 on a range of supported Operating Systems. Instructions for specific operating systems are available.

When MariaDB Enterprise Server is upgraded, the old version needs to be uninstalled, and the new version needs to be installed.

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.

    On MariaDB Community Server 10.4 and later:

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

    On MariaDB Community Server 10.3 and earlier:

    $ 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.

    On MariaDB Community Server 10.4 and later:

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

    On MariaDB Community Server 10.3 and earlier:

    $ 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.

Audit Plugin Considerations

If you have the MariaDB Audit Plugin installed and if you are upgrading to MariaDB Enterprise Server 10.4, then the audit plugin should be removed prior to the upgrade to prevent conflict with the MariaDB Enterprise Audit Plugin that is present in MariaDB Enterprise Server 10.4.

It can be removed by using the UNINSTALL SONAME statement:

UNINSTALL SONAME 'server_audit';

And if you load the plugin in a configuration file using the plugin_load_add option, then the option should also be removed.

The MariaDB Enterprise Audit Plugin will automatically be installed after installing MariaDB Enterprise Server 10.4.

Uninstall the Old Version

When upgrading to MariaDB Enterprise Server, it is necessary to remove the existing installation of MariaDB Community Server, before installing MariaDB Enterprise Server. Otherwise, the package manager will refuse to install MariaDB Enterprise Server.

Stop the MariaDB Server Process

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

  1. Stop the server process:

    For distributions that use systemd (most supported OSes), you can manage the Server process using the systemctl command:

    $ sudo systemctl stop mariadb
    

    For distributions that use Upstart (RHEL6, CentOS 6), you can manage the Server process using the service and chkconfig utilities:

    $ sudo service mysql stop
    

Uninstall via YUM (RHEL/CentOS)

  1. Uninstall all of the MariaDB Community Server packages. Note that a wildcard character is used to ensure that all MariaDB Community Server packages are uninstalled:

    $ sudo yum remove "MariaDB-*"
    

    Be sure to check that this wildcard does not unintentionally refer to any of your custom applications:

  2. Uninstall the Galera package as well.

    The name of the package depends on the specific version of MariaDB Community Server.

    When upgrading from MariaDB Community Server 10.4 or later, the package is called galera-4:

    $ sudo yum remove galera-4
    

    When upgrading from MariaDB Community Server 10.3 or earlier, the package is called galera:

    $ sudo yum remove galera
    
  3. Before proceeding, verify that all MariaDB Community Server packages are uninstalled. The following command should not return any results:

    $ rpm --query --all | grep -i -E "mariadb|galera"
    

Uninstall via APT (Debian/Ubuntu)

  1. Uninstall all of the MariaDB Community Server packages. Note that a wildcard character is used to ensure that all MariaDB Community Server packages are uninstalled:

    $ sudo apt remove "mariadb-*"
    

    Be sure to check that this wildcard does not unintentionally refer to any of your custom applications.

  2. Uninstall the Galera package as well.

    The name of the package depends on the specific version of MariaDB Community Server.

    When upgrading from MariaDB Community Server 10.4 or later, the package is called galera-4:

    $ sudo apt remove galera-4
    

    When upgrading from MariaDB Community Server 10.3 or earlier, the package is called galera:

    $ sudo apt remove galera
    
  3. Before proceeding, verify that all MariaDB Community Server packages are uninstalled. The following command should not return any results:

    $ apt list --installed | grep -i -E "mariadb|galera"
    

Uninstall via ZYpp (SLES)

  1. Uninstall all of the MariaDB Community Server packages. Note that a wildcard character is used to ensure that all MariaDB Community Server packages are uninstalled:

    $ sudo zypper remove "MariaDB-*"
    

    Be sure to check that this wildcard does not unintentionally refer to any of your custom applications.

  2. Uninstall the Galera package as well.

    The name of the package depends on the specific version of MariaDB Community Server.

    When upgrading from MariaDB Community Server 10.4 or later, the package is called galera-4:

    $ sudo zypper remove galera-4
    

    When upgrading from MariaDB Community Server 10.3 or earlier, the package is called galera:

    $ sudo zypper remove galera
    
  3. Before proceeding, verify that all MariaDB Community Server packages are uninstalled. The following command should not return any results:

    $ rpm --query --all | grep -i -E "mariadb|galera"
    

Install the New Version

MariaDB Corporation provides package repositories for YUM (RHEL/CentOS), APT (Debian/Ubuntu), and ZYpp (SLES).

Install via YUM (RHEL/CentOS)

  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 YUM package repository. Installable versions of MariaDB Enterprise Server are 10.5, 10.4, 10.3, and 10.2. Pass the version to install using the --mariadb-server-version flag to mariadb_es_repo_setup. The following directions reference 10.5.

    To configure YUM package repositories:

    $ sudo yum install wget
    
    $ wget https://dlm.mariadb.com/enterprise-release-helpers/mariadb_es_repo_setup
    
    $ echo "957bc29576e8fd320fa18e35fa49b5733f3c8eeb4ca06792fb1f05e089c810ff  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.5"
    
  3. Install MariaDB Enterprise Server and package dependencies:

    $ sudo yum install MariaDB-server MariaDB-backup
    
  4. Configure MariaDB.

    Installation only loads MariaDB Enterprise Server to the system. MariaDB Enterprise Server requires configuration before the database server is ready for use.

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.

    Installable versions of MariaDB Enterprise Server are 10.5, 10.4, 10.3, and 10.2. Pass the version to install using the --mariadb-server-version flag to mariadb_es_repo_setup. The following directions reference 10.5.

    To configure APT package repositories:

    $ sudo apt install wget
    
    $ wget https://dlm.mariadb.com/enterprise-release-helpers/mariadb_es_repo_setup
    
    $ echo "957bc29576e8fd320fa18e35fa49b5733f3c8eeb4ca06792fb1f05e089c810ff  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.5"
    
    $ sudo apt update
    
  3. Install MariaDB Enterprise Server and package dependencies:

    $ sudo apt install mariadb-server mariadb-backup
    
  4. Configure MariaDB.

    Installation only loads MariaDB Enterprise Server to the system. MariaDB Enterprise Server requires configuration before the database server is ready for use.

Install via ZYpp (SLES)

  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 ZYpp package repository.

    Installable versions of MariaDB Enterprise Server are 10.5, 10.4, 10.3, and 10.2. Pass the version to install using the --mariadb-server-version flag to mariadb_es_repo_setup. The following directions reference 10.5.

    To configure ZYpp package repositories:

    $ sudo zypper install wget
    
    $ wget https://dlm.mariadb.com/enterprise-release-helpers/mariadb_es_repo_setup
    
    $ echo "957bc29576e8fd320fa18e35fa49b5733f3c8eeb4ca06792fb1f05e089c810ff  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.5"
    
  3. Install MariaDB Enterprise Server and package dependencies:

    $ sudo zypper install MariaDB-server MariaDB-backup
    
  4. Configure MariaDB.

    Installation only loads MariaDB Enterprise Server to the system. MariaDB Enterprise Server requires configuration before the database server is ready for use.

Configuration

For platforms that use YUM or ZYpp as a package manager:

MariaDB Community Server's packages bundle several configuration files:

  • /etc/my.cnf

  • /etc/my.cnf.d/client.cnf

  • /etc/my.cnf.d/mysql-clients.cnf

  • /etc/my.cnf.d/server.cnf

If your version of any of these configuration files contained any custom edits, then the package manager may save your edited version with the .rpmsave extension during the upgrade process. If you want to continue using your version with the custom edits, then you may need to move it back. For example, to move server.cnf back in place:

$ sudo mv /etc/my.cnf.d/server.cnf /etc/my.cnf.d/server.cnf.original
$ sudo mv /etc/my.cnf.d/server.cnf.rpmsave /etc/my.cnf.d/server.cnf

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.

For distributions that use 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

For distributions that use Upstart (RHEL6, CentOS 6), you can manage the Server process using the service and chkconfig utilities:

Operation

Command

Start

sudo service mysql start

Stop

sudo service mysql stop

Restart

sudo service mysql restart

Enable during startup

sudo chkconfig --add mysql

Disable during startup

sudo chkconfig --del mysql

Status

sudo service mysql status

Upgrading the Data Directory

MariaDB Enterprise Server ships with a utility that 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.

The utility is called mariadb-upgrade in MariaDB Enterprise Server 10.4 and later:

$ sudo mariadb-upgrade

And the utility is called mysql_upgrade in MariaDB Enterprise Server 10.3 and 10.2:

$ 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.

    MariaDB Client is called mariadb (ES10.5, ES10.4) or mysql (ES10.3, ES10.2):

    $ sudo mariadb
    Welcome to the MariaDB monitor.  Commands end with ; or \g.
    Your MariaDB connection id is 9
    Server version: 10.5.4-MariaDB MariaDB 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.5.4-MariaDB |
    +---------------+------------------------------+
    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.5.4-MariaDB |
    +------------------------------+
    1 row in set (0.000 sec)