Upgrade to MariaDB Enterprise Server 10.3 on RHEL 7
These instructions detail the upgrade from a previous version of MariaDB Enterprise Server to MariaDB Enterprise Server 10.3 on Red Hat Enterprise Linux 7.
When MariaDB Enterprise Server is upgraded, the old version needs to be uninstalled, and the new version needs to be installed.
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.
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.
The backup must be prepared:
$ sudo mariabackup --prepare \ --target-dir=/data/backup/preupgrade_backup
Confirm successful completion of the prepare operation.
Backups should be tested before they are trusted.
Uninstall the Old Version
When upgrading to a new major release of MariaDB Enterprise Server, it is necessary to remove the existing installation of MariaDB Enterprise Server, before installing the new version of MariaDB Enterprise Server. Otherwise, the package manager will refuse to install the new version of 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.
Set the innodb_
fast_system variable to shutdown
SET GLOBAL innodb_fast_shutdown = 1;
Use XA RECOVER to confirm that there are no external XA transactions in a prepared state:
Commit or rollback any open XA transactions before stopping the node for upgrade.
Stop the server process using the
$ sudo systemctl stop mariadb
Uninstall via YUM (RHEL, CentOS, Rocky Linux)
Uninstall all of the MariaDB Enterprise Server packages. Note that a wildcard character is used to ensure that all MariaDB Enterprise 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:
Uninstall the Galera package as well.
The name of the package depends on the specific version of MariaDB Enterprise Server.
When upgrading from MariaDB Enterprise Server 10.4 or later, the package is called
$ sudo yum remove galera-enterprise-4
When upgrading from MariaDB Enterprise Server 10.3 or earlier, the package is called
$ sudo yum remove galera
Before proceeding, verify that all MariaDB Enterprise 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 a YUM package repository for Red Hat Enterprise Linux 7.
Install via YUM (RHEL, CentOS, Rocky Linux)
Retrieve your Customer Download Token at https://customers.mariadb.com/downloads/token/ and substitute for
CUSTOMER_DOWNLOAD_TOKENin the following directions.
Configure the YUM package repository.
To configure YUM package repositories:
$ sudo yum install wget
$ wget https://dlm.mariadb.com/enterprise-release-helpers/mariadb_es_repo_setup
$ echo "713a8f78ea7bab3eccfb46dc14e61cd54c5cf5a08acb5c320ef5370d375e48bd 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"
Install MariaDB Enterprise Server and package dependencies:
$ sudo yum install MariaDB-server MariaDB-backup
Installation of additional packages may be required for some plugins.
Installation only loads MariaDB Enterprise Server to the system. MariaDB Enterprise Server requires configuration before the database server is ready for use.
For platforms that use YUM or ZYpp as a package manager:
MariaDB Enterprise Server's packages bundle several configuration files:
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.
Red Hat Enterprise Linux 7 uses systemd. You can manage the Server process using the
Enable during startup
Disable during startup
Upgrading the Data Directory
MariaDB Enterprise Server 10.3 ships with the mysql_
$ sudo mysql_upgrade
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.
Connect to the server using MariaDB Client using the
$ sudo mysql
Welcome to the MariaDB monitor. Commands end with ; or \g. Your MariaDB connection id is 9 Server version: 10.3.36-17-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)]>
SHOW GLOBAL VARIABLES LIKE 'version';
+---------------+-------------------------------+ | Variable_name | Value | +---------------+-------------------------------+ | version | 10.3.36-17-MariaDB-Enterprise | +---------------+-------------------------------+
You can also verify the server version by calling the VERSION() function:
+-------------------------------+ | VERSION() | +-------------------------------+ | 10.3.36-17-MariaDB-Enterprise | +-------------------------------+