Dror
Dror

Reputation: 1322

Is it possible to migrate back from Amazon Aurora to native MySQL in Amazon RDS?

I saw Amazon introduced new Amazon Aurora MySQL migration from native MySQL to Amazon Aurora MySQL.

Would it be possible to migrate back from Amazon Aurora to regular MySQL with Amazon RDS?

Upvotes: 25

Views: 21242

Answers (3)

Boyd Hemphill
Boyd Hemphill

Reputation: 418

Percona has a series of steps to follow that outlines how to set up a MySQL replica from an Aurora master. You'd then be able to take it to RDS MySQL from there. In some cases this manual method might make sense.

Overview:

  1. Snap the Aurora instance
  2. Bring up a temp Aurora instance
  3. Dump it (mysqldump)
  4. Create the replica
  5. Migrate traffic

However as @ydaetskcoR suggests, Amazon has the tool and the use case defined for setting up such a replica with DMS. I'd start here is a direct link to that use case.

Upvotes: 0

Son Zion
Son Zion

Reputation: 1

If it's a small database, you can use tools such as Navicat or MySQL Workbench to export the data out. For big databases, you can download aws cli either for Windows or Linux, for Linux it comes with a pre-installed on Amazon Linux AMI. Use aws configure to set up credentials and regions. Use mysqldump from the cli remember the --single-transaction option to avoid locking and take dump preferable from slave replica.

For a subset of the data, you can either use: (Windows example)

mysql> SELECT * FROM database.table
WHERE ......
into OUTFILE '/location/of/path/dumpfile.txt'
FIELDS TERMINATED BY ','
OPTIONALLY ENCLOSED BY '"'
LINES TERMINATED BY "\n";
Query OK.... 

to extract just what you need as flat files which is faster to load into any other MySQL env. You can also setup permission to load into s3 as flat files and export anywhere again if the file is not as big. But for huge data, please use mysqldump.

Upvotes: 0

ydaetskcoR
ydaetskcoR

Reputation: 56987

Amazon's Aurora is MySQL wire compatible so you can always use tools such as mysqldump to get your data back out into a form that you could use to import back into a regular MySQL instance running in RDS, an EC2 instance or anywhere else for that matter.

Since posting this answer Amazon has also released the Database Migration Service which can be used to do zero downtime migrations between MySQL -> Aurora MySQL (Aurora also now supports PostgreSQL) and back. It also supports heterogeneous migrations such as from Oracle to Aurora MySQL or a number of other sources and targets.

Upvotes: 20

Related Questions