Peter shows you how to
restore data to a cluster
using S3

migrate-mysql-aurora-innobackup-peter

I want to migrate data from MySQL to Amazon Aurora. How do I restore MySQL data to an Amazon Aurora cluster using Amazon S3?

Amazon Aurora is compatible with MySQL 5.5 to MySQL 5.6. To restore a MySQL innobackupex backup, first install Percona Xtrabackup to your EC2 instance by using a command similar to the following:

sudo yum install percona-xtrabackup-file_name_and_extension

Note: Replace file_name_and_extension with the appropriate file name and extension based on your Percona Xtrabackup package, similar to the following:

sudo yum install percona-xtrabackup-24-2.4.7-1.el7.x86_64.rpm

Note: Use Percona Xtrabackup 2.3 or later.

After configuring the environment, you can upload your backup to S3 and create an Aurora instance.

Launch an EC2 instance and back up your MySQL database

1.    Launch an EC2 instance. For detailed instructions, see Step 1: Launch an Instance.

2.    After the instance is running, connect to the instance by using SSH.

3.    Start the MySQL service and make a note of the MySQL version.

4.    Enable EPEL.

5.    Make a directory for the backup using the following commands:

mkdir backup
cd backup

6.    Using a command similar to the following, back up the instance:

sudo innobackupex -u root -ppassword --stream=tar /tmp | gzip -9 > ./mybackup.tar.gz

Upload your backup to an S3 bucket

1.    Create an S3 bucket. For detailed instructions, see Create a Bucket.
       Note: Your bucket must be in the same region as your EC2 instance and your new Amazon Aurora cluster.

2.    Choose the bucket you created, and then choose Create Folder.

3.    Upload the files, set the permissions, set the properties, and choose Upload.

Import your database from S3 to Aurora

1.    Open the AWS RDS console, and choose RDS Dashboard in the navigation pane.

2.    Choose Restore Aurora DB Cluster from S3.

3.    Enter the Source Engine Version noted earlier.

4.    From the S3 Backup Location drop-down menu, select the S3 bucket you created and enter your S3 Bucket Prefix.
Note: Avoid leading or trailing slashes ("/") when entering the bucket name in the S3 Bucket Prefix field.

5.    Create an IAM role to give the RDS service permission to access the S3 bucket and choose Next Step.

6.    Specify your DB details and choose Next Step.

7.    Configure your Advanced Settings and Database Options, and enter the IAM role you created for the DB Cluster Identifier.

8.    Choose Launch DB Instance.

9.    After the cluster is available, choose View Your DB Instances to confirm the Aurora Instance was created successfully.


Did this page help you? Yes | No

Back to the AWS Support Knowledge Center

Need help? Visit the AWS Support Center

Published: 2016-03-31

Updated: 2017-11-17