hohner
hohner

Reputation: 11588

What's the best way to migrate large amounts of data to another server?

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...

Upvotes: 0

Views: 374

Answers (4)

Felipe Buccioni
Felipe Buccioni

Reputation: 19688

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.

Upvotes: 0

Felipe Buccioni
Felipe Buccioni

Reputation: 19688

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.

Upvotes: 0

Martin Schlagnitweit
Martin Schlagnitweit

Reputation: 2101

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 [email protected]:/path/on/new/server

Upvotes: 1

Marc B
Marc B

Reputation: 360792

tar cfz - /path/to/your/data|ssh [email protected] echo > oldserver.tar.gz

Upvotes: 3

Related Questions