Migrating data from a MySQL DB snapshot to a MariaDB DB instance
You can migrate an RDS for MySQL DB snapshot to a new DB instance running MariaDB using the AWS Management Console, the AWS CLI, or Amazon RDS API. You must use a DB snapshot that was created from an Amazon RDS DB instance running MySQL 5.6 or 5.7. To learn how to create an RDS for MySQL DB snapshot, see Creating a DB snapshot for a Single-AZ DB instance for Amazon RDS.
Migrating the snapshot doesn't affect the original DB instance from which the snapshot was taken. You can test and validate the new DB instance before diverting traffic to it as a replacement for the original DB instance.
After you migrate from MySQL to MariaDB, the MariaDB DB instance is associated with the default
DB parameter group and option group. After you restore the DB snapshot, you can associate a custom DB parameter group
with the new DB instance. However, a MariaDB parameter group has a different set of configurable system variables.
For information about the differences between MySQL and MariaDB system variables,
see
System Variable Differences between MariaDB and MySQL
Performing the migration
You can migrate an RDS for MySQL DB snapshot to a new MariaDB DB instance using the AWS Management Console, the AWS CLI, or the RDS API.
To migrate a MySQL DB snapshot to a MariaDB DB instance
-
Sign in to the AWS Management Console and open the Amazon RDS console at https://console.aws.amazon.com/rds/
. -
In the navigation pane, choose Snapshots, and then select the MySQL DB snapshot you want to migrate.
-
For Actions, choose Migrate snapshot. The Migrate database page appears.
-
For Migrate to DB Engine, choose mariadb.
Amazon RDS selects the DB engine version automatically. You can't change the DB engine version.
-
For the remaining sections, specify your DB instance settings. For information about each setting, see Settings for DB instances.
-
Choose Migrate.
To migrate data from a MySQL DB snapshot to a MariaDB DB instance, run the AWS CLI
restore-db-instance-from-db-snapshot
command with
the following options:
--db-instance-identifier – Name of the DB instance to create from the DB snapshot.
--db-snapshot-identifier – The identifier for the DB snapshot to restore from.
--engine – The database engine to use for the new instance.
For Linux, macOS, or Unix:
aws rds restore-db-instance-from-db-snapshot \ --db-instance-identifier
newmariadbinstance
\ --db-snapshot-identifiermysqlsnapshot
\ --enginemariadb
For Windows:
aws rds restore-db-instance-from-db-snapshot ^ --db-instance-identifier
newmariadbinstance
^ --db-snapshot-identifiermysqlsnapshot
^ --enginemariadb
To migrate data from a MySQL DB snapshot to a MariaDB DB instance, call the Amazon RDS API operation
RestoreDBInstanceFromDBSnapshot
.
Incompatibilities between MariaDB and MySQL
Incompatibilities between MySQL and MariaDB include the following:
You can't migrate a DB snapshot created with MySQL 8.0 to MariaDB.
If the source MySQL database uses a SHA256 password hash, make sure to reset user passwords that are SHA256 hashed before you connect to the MariaDB database. The following code shows how to reset a password that is SHA256 hashed.
SET old_passwords = 0; UPDATE mysql.user SET plugin = 'mysql_native_password', Password = PASSWORD('new_password') WHERE (User, Host) = ('master_user_name', %); FLUSH PRIVILEGES;
If your RDS master user account uses the SHA-256 password hash, make sure to reset the password using the AWS Management Console, the
modify-db-instance
AWS CLI command, or the ModifyDBInstance RDS API operation. For information about modifying a DB instance, see Modifying an Amazon RDS DB instance.MariaDB doesn't support the Memcached plugin. However, the data used by the Memcached plugin is stored as InnoDB tables. After you migrate a MySQL DB snapshot, you can access the data used by the Memcached plugin using SQL. For more information about the innodb_memcache database, see InnoDB memcached Plugin Internals
.