将大量数据迁移到另一台服务器的最佳方法是什么?

I'm currently migrating a Magento installation to a new, separate server and I was wondering whether there's any method I could use apart from an FTP program like FileZilla. The backup size is around 4GB - so this would take hours to download and upload to the new location.

Is there any way of copying/moving files between servers? I looked at PHP's FTP functionality, but I'm unsure if this is the right way to go. I tried searching for previous questions, but all I found was Python and C++ solutions which I'm not that comfortable using...

tar cfz - /path/to/your/data|ssh user@newserver.com echo > oldserver.tar.gz

Yes, with SSH and scp

Assuming that you have ssh access (on both servers) and are working on linux machines, you can login to the old server via ssh and then use scp:

scp /path/to/backup.tar.gz username@new-server.com:/path/on/new/server

is posibbly between servers, but you need

tar and if you want, compress it. you could use native php extensions, or pear extensions.

So you need to uncompres

  1. Make a compress file of backup in the source server
  2. In the destiny server do a script what writes tar, here could be 2 scenarios.

    then you unpack with pear Archive_tar (if you add compression, you need to add here too)

    $tar = new Archive_Tar('http://my-old-host.tld/archive.tar'); $tar->extract(dirname(FILE).'/backup_from_server/');

The most easy HTTP compatible way that i think. have a nice day.

with ssh is much more simplier

tar -jcvf - /backup-directory | ssh user@destiny-server sh -c 'mkdir backup; cd backup; tar -jxvf -'

this sent compressed the stream in the network to make it more faster.