Fastest way to transfer a MySQL dump to a remote host

I need to transfer a rather big MySQL dump from one host to another, but since I need to make it the fastest I can, as the service rely on this database and I cannot do otherwise (like a replica).

So I was wondering myself what could be the fastest way to generate, transfer and restore the dump. The classic steps I would take are:

  1. dump the db;
  2. gzip the files;
  3. copy them via scp/rsync;
  4. restore.

But then I though: is it all necessary? For example the gzipping part, is it really required? It takes CPU and IO on both the source and the destination, but of course you don’t want to move Gigabyte worth of text file over internet.

Continua a leggere