We had a fair bit of data piled up at our virtual server on The Rackspace Cloud’s Cloud Sites system (previously known as Mosso). When we decided to move off Cloud Sites and on to Amazon EC2 moving that data quickly became extremely important. MySQL offers several methods of transporting data from the database and mirroring/replication seemed to be the ideal fit since we’d get our data synchronized in real time with the old database. Unfortunately, because of the way Cloud Sites are configured we can’t use mirroring at all (it’s already being used internally by Rackspace for scaling).
Since, we were using Cloud Sites we didn’t have SSH access to our box. Rackspace recommended we use mysqldump on another server and connect to our MySQL instance to grab the data directly over the internet. Two problems with that:
- Moving 15GB. of data on a single connection sequentially would take forever. (We were getting only ~200Kb/sec)
- The data would not be compressed, so we’d have to move the full 15GB.
- Setup a virtual Cloud Server on Rackspace Cloud with enough space for the data.
- Use mysqldump on this new server to connect to Cloud Sites and grab the data. Since they’re in the same server farm you get much much higher transfer rates.
- Compress using gzip and place in a web server document directory.
- On the Amazon server use aget to download the newly compressed gz file. We used 10 parts and got about 1800Kb/sec.
- Unzip and execute the SQL.
This reduced the amount of time needed to manageable proportions and therefore caused a minimal service outage.