Is there a fast way to export MySQL data from AWS RDS and import it into Google CloudSQL?

21 views
Skip to first unread message

Jacob Peebles

unread,
Aug 20, 2019, 7:44:17 PM8/20/19
to Google Cloud SQL discuss

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?

George (Cloud Platform Support)

unread,
Aug 21, 2019, 6:30:24 PM8/21/19
to Google Cloud SQL discuss
Hello Jacob, 

You may consider following related Cloud SQL documentation: "Importing data into Cloud SQL". This discussion group is oriented more towards general opinions, trends, and issues of general nature touching Cloud SQL. For coding and program architecture, as well as exporting and importing MySQL data, you may be better served in dedicated forums such as stackoverflow, where experienced programmers are within reach and ready to help.
Reply all
Reply to author
Forward
0 new messages