RDS snapshot migration - Migrating Your Databases to Amazon Aurora

RDS snapshot migration

To use RDS snapshot migration to move to Aurora, your MySQL database must be running on Amazon RDS MySQL 5.6 or 5.7, and you must make an RDS snapshot of the database. This migration method does not work with on-premises databases or databases running on Amazon Elastic Compute Cloud (Amazon EC2). Also, if you are running your Amazon RDS MySQL database on a version earlier than 5.6, you would need to upgrade it to 5.6 as a prerequisite.

The biggest advantage to this migration method is that it is the simplest and requires the fewest number of steps. In particular, it migrates over all schema objects, secondary indexes, and stored procedures along with all of the database data.

During snapshot migration without binlog replication, your source database must either be offline or in a read-only mode (so that no changes are being made to the source database during migration). To estimate downtime, you can simply use the existing snapshot of your database to do a test migration. If the migration time fits within your downtime requirements, then this may be the best method for you. Note that in some cases, migration using AWS DMS or native migration tools can be faster than using snapshot migration.

If you can’t tolerate extended downtime, you can achieve near-zero downtime by creating an Aurora Read Replica from a source RDS MySQL. This migration option is explained in the Migrating using Aurora Read Replica section in this document.

You can migrate either a manual or an automated DB snapshot. The general steps you must take are as follows:

  1. Determine the amount of space that is required to migrate your Amazon RDS MySQL instance to an Aurora DB cluster. For more information, see the next section.

  2. Use the Amazon RDS console to create the snapshot in the Region where the Amazon RDS MySQL instance is located.

  3. Use the Migrate Database feature on the console to create an Amazon Aurora DB cluster that will be populated using the DB snapshot from the original DB instance of MySQL.

Note

Some MyISAM tables might not convert without errors and may require manual changes. For instance, the InnoDB engine does not permit an autoincrement field to be part of a composite key. Also, spatial indexes are not currently supported.

Estimating space requirements for snapshot migration

When you migrate a snapshot of a MySQL DB instance to an Aurora DB cluster, Aurora uses an Amazon Elastic Block Store (Amazon EBS) volume to format the data from the snapshot before migrating it. There are some cases where additional space is needed to format the data for migration. The two features that can potentially cause space issues during migration are MyISAM tables and using the ROW_FORMAT=COMPRESSED option. If you are not using either of these features in your source database, then you can skip this section because you should not have space issues. During migration, MyISAM tables are converted to InnoDB and any compressed tables are uncompressed. Consequently, there must be adequate room for the additional copies of any such tables.

The size of the migration volume is based on the allocated size of the source MySQL database that the snapshot was made from. Therefore, if you have MyISAM or compressed tables that make up a small percentage of the overall database size and there is available space in the original database, then migration should succeed without encountering any space issues. However, if the original database would not have enough room to store a copy of converted MyISAM tables as well as another (uncompressed) copy of compressed tables, then the migration volume will not be big enough. In this situation, you would need to modify the source Amazon RDS MySQL database to increase the database size allocation to make room for the additional copies of these tables, take a new snapshot of the database, and then migrate the new snapshot.

When migrating data into your DB cluster, observe the following guidelines and limitations:

  • Although Amazon Aurora supports up to 128 TB of storage, the process of migrating a snapshot into an Aurora DB cluster is limited by the size of the Amazon EBS volume of the snapshot, and therefore is limited to a maximum size of 16 TB.

  • Non-MyISAM tables in the source database can be up to 16 TB in size. However, due to additional space requirements during conversion, make sure that none of the MyISAM and compressed tables being migrated from your MySQL DB instance exceed 8 TB in size.

You might want to modify your database schema (convert MyISAM tables to InnoDB and remove ROW_FORMAT=COMPRESSED) prior to migrating it into Amazon Aurora. This can be helpful in the following cases:

  • You want to speed up the migration process.

  • You are unsure of how much space you need to provision.

  • You have attempted to migrate your data and the migration has failed due to a lack of provisioned space.

Make sure that you are not making these changes in your production Amazon RDS MySQL database but rather on a database instance that was restored from your production snapshot. For more details, refer to the Amazon Relational Database Service User Guide.

Migrating a DB snapshot using the console

You can migrate a DB snapshot of an Amazon RDS MySQL DB instance to create an Aurora DB cluster. The new DB cluster is populated with the data from the original Amazon RDS MySQL DB instance. The DB snapshot must have been made from an RDS DB instance running MySQL 5.6 or 5.7. For information about creating a DB snapshot, refer to Creating a DB snapshot in the Amazon RDS User Guide.

If the DB snapshot is not in the Region where you want to locate your Aurora DB cluster, use the Amazon RDS console to copy the DB snapshot to that Region. For information about copying a DB snapshot, refer to Copying a snapshot in Amazon RDS User Guide.

To migrate a MySQL DB snapshot using the AWS Management Console, do the following:

  1. Sign in to the AWS Management Console and open the Amazon RDS console (sign in required).

  2. Choose Snapshots.

  3. On the Snapshots page, choose the Amazon RDS MySQL snapshot that you want to migrate into an Aurora DB cluster.

  4. Choose Migrate Database.

  5. On the Migrate Database page, specify the values that match your environment and processing requirements as shown in the following illustration. For descriptions of these options, refer to Migrating an RDS for MySQL snapshot to Aurora in the Amazon Aurora User Guide.

A screenshot of the Amazon RDS Console during snapshot migration.

Amazon RDS console: snapshot migration screens

Another screenshot of the Amazon RDS Console during snapshot migration.

Amazon RDS console: snapshot migration screens

Another screenshot of the Amazon RDS Console during snapshot migration.

Amazon RDS console: snapshot migration screens

  1. Choose Migrate to migrate your DB snapshot.

In the list of instances, choose the appropriate arrow icon to show the DB cluster details and monitor the progress of the migration. This details panel displays the cluster endpoint used to connect to the primary instance of the DB cluster. For more information on connecting to an Amazon Aurora DB cluster, refer to Connecting to an Amazon Aurora DB cluster in the Amazon Aurora User Guide.