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


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 (version 2.3 or later) 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

After configuring the environment, you can upload your backup to Amazon Simple Storage Service (Amazon S3) and then create an Aurora cluster.

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 note 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.    Choose the folder, and choose Upload.

4.    Upload the files, set the permissions, set the properties, and then choose Upload.

Import your database from Amazon S3 to Aurora

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

2.    Choose Restore Aurora DB Cluster from S3.

3.    Enter the Source Engine Version you noted earlier.

4.    From the S3 Backup Location drop-down menu, select the S3 bucket you created and enter your S3 Bucket Prefix.

Note: Don't use 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: 2018-01-16