Migrating from MariaDB 10.0 to MariaDB 10.1 Software Collections (RHEL6 and RHEL7)

Updated

MariaDB 10.0 has been available for RHEL6 and RHEL7 as a Software Collection since Red Hat Software Collections (RHSCL) 2.0. Since RHSCL 2.2, the MariaDB 10.1 Software Collection has been available for RHEL6 and RHEL7. This article describes how to upgrade from MariaDB 10.0 to MariaDB 10.1.

Read also Content from mariadb.com is not included.upstream documentation about MariaDB 10.1 changes and Content from mariadb.com is not included.upgrading.

Please note that the rh-mariadb101 Software Collection supports neither mounting over NFS nor dynamical registering using the scl register command.

Also note that since MariaDB 10.1.7, the SQL_MODE variable is by default set to NO_ENGINE_SUBSTITUTION,NO_AUTO_CREATE_USER while in earlier versions of MariaDB no default was set. Consequently, the GRANT statement does not create a user by default. The setting of the SQL_MODE variable can be changed in the configuration file. See the Content from mariadb.com is not included.upstream documentation for details.

If you are using MariaDB 5.5, it is necessary to upgrade to the rh-mariadb100 Software Collection first, which is described in the article Migrating from MySQL 5.5 or MariaDB 5.5 to the MariaDB 10.0 Software Collection (RHEL6 and RHEL7) .

How to upgrade

Prior to upgrading, back up all your data, including any MariaDB databases.

Step 1: Install the rh-mariadb101 Software Collection

Because the rh-mariadb101 Software Collection does not conflict with the rh-mariadb100 Software Collection, it is possible to install the rh-mariadb101 Software Collection, while the rh-mariadb100 Software Collection is still installed (and even running).

yum install rh-mariadb101-mariadb-server

Step 2: Inspect the configuration

The configuration of the rh-mariadb101 Software Collection is stored in /etc/opt/rh/rh-mariadb101/my.cnf and /etc/opt/rh/rh-mariadb101/my.cnf.d/. Compare it with configuration of the rh-mariadb100 Software Collection, which is stored in /etc/opt/rh/rh-mariadb100/my.cnf and /etc/opt/rh/rh-mariadb100/my.cnf.d/. and adjust it if necessary.

Step 3: Copy the data

Stop the rh-mariadb100 database server if it is still running.

service rh-mariadb100-mariadb stop

All the data of the rh-mariadb100 Software Collection is stored in /var/opt/rh/rh-mariadb100/lib/mysql/. Copy the whole content of this directory to /var/opt/rh/rh-mariadb101/lib/mysql/. You can also move the content, but remember to back up your data before you go on with the upgrade.

Step 4: Start rh-mariadb101-mariadb service and run mysql_upgrade

Start the rh-mariadb101 database server with command:

service rh-mariadb101-mariadb start

Perform data migration.

scl enable rh-mariadb101 mysql_upgrade

In case the root user has a non-empty password defined (it should have a password defined), it is necessary to call the mysql_upgrade utility with the -p option and specify the password.

scl enable rh-mariadb101 -- mysql_upgrade -p
Category
Article Type