Menu
Amazon Relational Database Service
User Guide (API Version 2014-10-31)

Migrating Data from a MySQL DB Snapshot to a MariaDB DB Instance

You can migrate an Amazon RDS MySQL DB snapshot to a new DB instance running MariaDB 10.1 using the AWS Management Console, AWS CLI, or Amazon RDS API. You must create the DB snapshot from an Amazon RDS DB instance running MySQL 5.6. To learn how to create an RDS MySQL DB snapshot, see Creating a DB Snapshot.

After you migrate from MySQL to MariaDB, the MariaDB DB instance will be associated with the default DB parameter group and option group. After you restore the DB snapshot, you can associate a custom DB parameter group for 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 10.0 and MySQL 5.6. To learn about DB parameter groups, see Working with DB Parameter Groups. To learn about option groups, see Working with Option Groups.

Incompatibilities Between MariaDB and MySQL

Incompatibilities between MySQL and MariaDB include the following:

  • You cannot migrate a DB snapshot created with MySQL 5.7 or MySQL 5.5 to MariaDB 10.1.

  • If the source MySQL database uses a SHA256 password hash, you need to reset user passwords that are SHA256 hashed before you can connect to the MariaDB database. The following code shows how to reset a password that is SHA256 hashed:

    Copy
    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, the password has to be reset using the rds modify-db-instance AWS CLI command, ModifyDBInstance API action, or the AWS Management Console. For information about modifying a MariaDB DB instance, see Modifying a DB Instance Running the MariaDB Database Engine.

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

AWS Management Console

To migrate a MySQL DB snapshot to a MariaDB DB instance

  1. Sign in to the AWS Management Console and open the Amazon RDS console at https://console.aws.amazon.com/rds/.

  2. In the navigation pane, choose Snapshots.

  3. Choose Migrate Snapshot.

  4. For Migrate to DB Engine, choose MariaDB.

  5. On the Migrate Database page, provide additional information that RDS needs to launch the MariaDB DB instance.

    • DB Instance Class: Choose a DB instance class that has the required storage and capacity for your database, for example db.r3.large. For any production application that requires fast and consistent I/O performance, we recommend Provisioned IOPS storage. For more information, see Provisioned IOPS Storage. MariaDB 10.1 does not support previous generation DB instance classes. For more information, see DB Instance Class.

    • DB Snapshot ID: Type a name for the DB snapshot identifier.

      The DB snapshot identifier has the following constraints:

      • It must contain from 1 to 255 alphanumeric characters or hyphens.

      • The character must be a letter.

      • It cannot end with a hyphen or contain two consecutive hyphens.

      If you are restoring from a shared manual DB snapshot, the DB snapshot identifier must be the Amazon Resource Name (ARN) of the shared DB snapshot.

    • DB Instance Identifier: Type a name for the DB instance that is unique for your account in the AWS Region where the DB instance will reside. This identifier is used in the endpoint addresses for the instances in your DB instance.

      The DB instance identifier has the following constraints:

      • It must contain from 1 to 63 alphanumeric characters or hyphens.

      • Its first character must be a letter.

      • It cannot end with a hyphen or contain two consecutive hyphens.

      • It must be unique for all DB instances for your AWS account, within an AWS Region.

    • VPC: If you have an existing VPC, then you can use that VPC with your MariaDB DB instance by selecting your VPC identifier, for example vpc-a464d1c1. For more information about VPC, see Amazon Virtual Private Cloud (VPCs) and Amazon RDS .

      Otherwise, you can choose to have Amazon RDS create a VPC for you by selecting Create a new VPC.

      You cannot create MariaDB instances in the EC2 Classic Network.

    • Subnet Group: If you have an existing subnet group, then you can use that subnet group with your MariaDB DB instance by selecting your subnet group identifier, for example gs-subnet-group1.

      Otherwise, you can choose to have Amazon RDS create a subnet group for you by selecting Create a new subnet group.

    • Publicly Accessible: Choose No to specify that instances in your DB instance can only be accessed by resources inside your VPC. Choose Yes to specify that instances in your DB instance can be accessed by resources on the public network. The default is Yes.

    • Availability Zone: Choose the Availability Zone to host the primary instance for your MariaDB DB instance. To have Amazon RDS choose an Availability Zone for you, choose No Preference.

    • Database Port: Type the default port to be used when connecting to instances in the DB instance. The default is 3306.

      You might be behind a corporate firewall that doesn't allow access to default ports such as the MySQL default port 3306. In this case, provide a port value that your corporate firewall allows.

    • Enable Encryption: Choose Yes for your new MariaDB DB instance to be encrypted "at rest." If you choose Yes, you will be required to choose an AWS KMS encryption key as the Master Key value.

    • Auto Minor Version Upgrade: Choose Yes if you want to enable your MariaDB DB instance to receive minor MySQL DB engine version upgrades automatically when they become available. The Auto Minor Version Upgrade option only applies to upgrades to MySQL minor engine versions for your MariaDB DB instance. It doesn't apply to regular patches applied to maintain system stability.

  6. Choose Migrate.

    
                                Migrate to MariaDB from MySQL

CLI

To migrate data from a MySQL DB snapshot to a MariaDB DB instance, use the AWS CLI restore-db-instance-from-db-snapshot command with the following parameters:

  • --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, OS X, or Unix:

Copy
aws rds restore-db-instance-from-db-snapshot \ --db-instance-identifier newmariadbinstance \ --db-snapshot-identifier mysqlsnapshot \ --engine mariadb

For Windows:

Copy
aws rds restore-db-instance-from-db-snapshot \ --db-instance-identifier newmariadbinstance ^ --db-snapshot-identifier mysqlsnapshot ^ --engine mariadb

API

To migrate data from a MySQL DB snapshot to a MariaDB DB instance, call the Amazon RDS API action RestoreDBInstanceFromDBSnapshot.

Example

Copy
https://rds.us-west-2.amazonaws.com/ ?Action=RestoreDBInstanceFromDBSnapshot &DBInstanceIdentifier= newmariadbinstance &DBSnapshotIdentifier= mysqlsnapshot &Engine= mariadb &SignatureMethod=HmacSHA256 &SignatureVersion=4 &Version=2013-09-09 &X-Amz-Algorithm=AWS4-HMAC-SHA256 &X-Amz-Credential=AKIADQKE4SARGYLE/20140428/us-west-2/rds/aws4_request &X-Amz-Date=20140428T232655Z &X-Amz-SignedHeaders=content-type;host;user-agent;x-amz-content-sha256;x-amz-date &X-Amz-Signature=78ac761e8c8f54a8c0727f4e67ad0a766fbb0024510b9aa34ea6d1f7df52fe92

Related Topics