Database – Best way to migrate a large database from EC2 to RDS MySQL

amazon ec2amazon-web-servicesdatabasemysql-replicationrds

I currently have my database on a MySQL server hosted in a dedicated EC2 instance and planning to migrate the DB to a RDS backed MySQL server.

Now the issue I have is with migrating the data from EC2 to RDS. The database is nearly 185 GB and at this point I do not worry about downtime or having the data in sync with production. All I need at the moment is to basically take a dump and import it to the RDS.

This is what I have tried so far,

  1. I took a mysql dump of the db that is running on EC2
  2. Accessed the RDS instance from the same EC2 instance
  3. Used the source command from MySQL to import the data dump to RDS

It takes almost one day for nearly 35Gb to be imported and never managed to completely import the DB. Appreciate if someone could tip me as to how I could do this.

Best Answer

AWS offers the Database Migration Service (DMS) for exactly this. DMS can migrate from on-premises, EC2 or RDS instances. It offers progress, statistics and more.

AWS blog: AWS Database Migration Service