Migrating from MariaDB 10.1 to the MariaDB 10.2 Software Collection (RHEL6 and RHEL7)
MariaDB 10.1 has been available for RHEL6 and RHEL7 as a Software Collections since Red Hat Software Collections (RHSCL) 2.2. Since RHSCL 3.0, the MariaDB 10.2 Software Collection has been available for RHEL6 and RHEL7. This article describes how to upgrade from MariaDB 10.1 to MariaDB 10.2.
MariaDB 10.2 brings several new features, you can read more about them in:
- Content from mariadb.com is not included.Window Functions
- Content from mariadb.com is not included.mysqlbinlog now supports continuous binary log backups
- Content from mariadb.com is not included.Recursive Common Table Expressions
- Content from mariadb.com is not included.JSON functions
Read also Content from mariadb.com is not included.upstream documentation about MariaDB 10.2 changes and Content from mariadb.com is not included.upgrading.
Please note that the rh-mariadb102 Software Collection supports neither mounting over NFS nor dynamical registering using the scl register command.
Also note that since MariaDB 10.2, behavior of the SQL_MODE variable has been changed; see the Content from mariadb.com is not included.upstream documentation for details.
If you are using MariaDB 5.5 or MariaDB 10.0, it is necessary to upgrade to the rh-mariadb101 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) and Migrating from MariaDB 10.0 to MariaDB 10.1 Software Collections (RHEL6 and RHEL7).
How to upgrade
Prior to upgrading, back up all your data, including any MariaDB databases.
Step 1: Stop the rh-mariadb101 database server if it is still running
Before stopping the server, set the innodb_fast_shutdown option to 0, so that InnoDB performs a slow shutdown, including a full purge and insert buffer merge. Read more about this option in the Content from mariadb.com is not included.upstream documentation. This operation can take a longer time than in case of a normal shutdown.
Set innodb_fast_shutdown to 0.
mysql -uroot -p -e "SET GLOBAL innodb_fast_shutdown = 0"
Stop the rh-mariadb101 server.
service rh-mariadb101-mariadb stop
Step 2: Install the rh-mariadb102 Software Collection
yum install rh-mariadb102-mariadb-server
Note that it is possible to install the rh-mariadb102 Software Collection while the rh-mariadb101 Software Collection is still installed because these Collections do not conflict.
Step 3: Inspect configuration
Configuration of the rh-mariadb102 Software Collection is stored in the /etc/opt/rh/rh-mariadb102/my.cnf file and the /etc/opt/rh/rh-mariadb102/my.cnf.d/ directory. Compare it with configuration of the rh-mariadb101 Software Collection, which is stored in /etc/opt/rh/rh-mariadb101/my.cnf and /etc/opt/rh/rh-mariadb101/my.cnf.d/ and adjust it if necessary.
Step 4: Copy data
All data of the rh-mariadb101 Software Collection is stored in /var/opt/rh/rh-mariadb101/lib/mysql/ unless configured differently. Copy the whole content of this directory to /var/opt/rh/rh-mariadb102/lib/mysql/. You can move the content but remember to back up your data before you continue to upgrade. Make sure the data are owned by the mysql user and SELinux context is correct.
Step 5: Start the rh-mariadb102 database server
Start the rh-mariadb102-mariadb service.
service rh-mariadb102-mariadb start
Step 6: Perform the data migration
Run the mysql_upgrade command.
scl enable rh-mariadb102 mysql_upgrade
If 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-mariadb102 -- mysql_upgrade -p
Incompatible changes in server system variables
The following are options that either changed defaults, were made deprecated or were removed at all. For more information, see the list bellow and read the upstream documentation:
- Content from mariadb.com is not included.Content from mariadb.com is not included.https://mariadb.com/kb/en/mariadb/what-is-mariadb-102/
- Content from mariadb.com is not included.Content from mariadb.com is not included.https://mariadb.com/kb/en/mariadb/upgrading-from-mariadb-101-to-mariadb-102/
- Content from mariadb.com is not included.Content from mariadb.com is not included.https://mariadb.com/kb/en/mariadb/xtradbinnodb-server-system-variables/
Options with changed defaults:
aria_recover
binlog_annotate_row_events
binlog_checksum
binlog_format
group_concat_max_len
innodb_autoinc_lock_mode
innodb_buffer_pool_dump_at_shutdown
innodb_buffer_pool_dump_pct
innodb_buffer_pool_instances
innodb_buffer_pool_load_at_startup
innodb_checksum_algorithm
innodb_file_format
innodb_large_prefix
innodb_lock_schedule_algorithm
innodb_log_compressed_pages
innodb_max_dirty_pages_pct_lwm
innodb_max_undo_log_size
innodb_purge_threads
innodb_strict_mode
innodb_undo_directory
innodb_use_atomic_writes
innodb_use_trim
lock_wait_timeout
log_slow_admin_statements
log_slow_slave_statements
log_warnings
max_allowed_packet
max_long_data_size
myisam_recover_options
optimizer_switch
replicate_annotate_row_events
server_id
slave_net_timeout
sql_mode
thread_cache_size
thread_pool_max_threads
thread_stack
Removed options:
innodb_additional_mem_pool_size
innodb_api_bk_commit_interval
innodb_api_disable_rowlock
innodb_api_enable_binlog
innodb_api_enable_mdl
innodb_api_trx_level
innodb_mirrored_log_groups
innodb_use_sys_malloc
Deprecated options:
innodb_cleaner_lsn_age_factor
innodb_corrupt_table_action
innodb_empty_free_list_algorithm
innodb_fake_changes
innodb_file_format
innodb_file_format_check
innodb_file_format_max
innodb_foreground_preflush
innodb_instrument_semaphores
innodb_kill_idle_transaction
innodb_large_prefix
innodb_lazy_drop_table
innodb_locking_fake_changes
innodb_log_arch_dir
innodb_log_arch_expire_sec
innodb_log_archive
innodb_log_block_size
innodb_log_checksum_algorithm
innodb_max_bitmap_file_size
innodb_max_changed_pages
innodb_sched_priority_cleaner
innodb_show_locks_held
innodb_show_verbose_locks
innodb_support_xa
innodb_track_changed_pages
innodb_track_redo_log_now
innodb_use_fallocate
innodb_use_global_flush_log_at_trx_commit
innodb_use_stacktrace
innodb_use_trim