How to Transfer (Migrate) a Complete Site From One Server to Another

If you ever have a need to migrate a website from one server to another, it can be a huge deal, especially when dealing with Magento, which has tens of thousands of files. Also, if your Magento store has many products, you have all those thousands of image files to move too. You could try FTP, but usually our servers hang during a large transfer. Even if you could do it by FTP, it would take hours at best to transfer a complete Magento site.

So here’s how to do a complete site migration using SSH. This can be used for any website you have root access to, not just a Magento site.

1. Login to server 1 via SSH and open the folder which you want to backup. You’ll probably need to login as root user.

Use this commands:

cd /home/somepath/to/yourwebsite/public_html

2. Make a compressed archive out of this folder using the command

Next:

tar -cvf sitepack.tar ./

3. Login to server 2 via SSH and use the command below to fetch the backup from server

wget yourdomain.com/sitepack.tar

4. Now uncompress the archive using the command

tar -xvf sitepack.tar

This is the easiest way we know of to move large websites with tons of files.

You must be logged in to post a comment.