Tuesday, August 20, 2019

[google-cloud-sql-discuss] Is there a fast way to export MySQL data from AWS RDS and import it into Google CloudSQL?

I have a 885 GB MySQL 5.6 database running in Amazon RDS. I'd like to move it into Google's CloudSQL service. To do so I'm taking the following steps:

Following Amazon's instructions for moving a database out of RDS (since Google seems to require GTID for replication and RDS does not supported GTID for MySQL 5.6).

  1. 1. Created a RDS read-replica.
  2. 2. Once the read-replica was up to date with the master I stopped replication, recorded the binlog location, and dumped the database to a file.
  3. 3. Brought up an EC2 instance running Ubuntu and MySQL 5.6 and I'm importing the dump file into the EC2 database.

The problem I'm having is the import of the dump file into the EC2 database is taking much longer than I had hoped. After about 3 and half days the EC2 instance is only about 60% done with the database load.

The mysqldump command I ran was based off Amazon's recommendation...


mysqldump -h RdsInstanceEndpoint \      -u user \      -p password \      --port=3306 \      --single-transaction \      --routines \      --triggers \      --databases  database database2 \      --compress  \      --compact > dumpfile.sql.gz


I decompressed the dumpfile and to import the data I am simply running...


mysql -u user -p password < dumpfile.sql


Is there anything I can do to make this process run faster? Are there any command line options I should be using that I am not?

--
You received this message because you are subscribed to the Google Groups "Google Cloud SQL discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-cloud-sql-discuss+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-cloud-sql-discuss/4a24f023-cac8-4efc-b1a2-f5cb0c81ef65%40googlegroups.com.

No comments:

Post a Comment