Transferring files between host servers

If you’ve ever moved websites between hosts or wanted to set up a development version of a client site then you’ll have copied files from one and made them available to the other. The basic method for doing this is to ftp into the source server, download the files to your computer, ftp to the new server and upload the files there. The problem with this is that it takes ages to do when you’ve got large websites.

Despite having been doing web development for a number of years I’ve never thought about this before as I would always follow this process. However, given that I run a number of Magento sites for clients now and that there are a lot of pressure on my time I need a quick way to do this. So, after about 20 minutes research I realised there is a really easy way.

First on the source system compress the file into a .zip or .tar.gz file. Most hosts provide tools to do this. I know CPanel and DirectAdmin do. Next, download this. As long as you’ve a fast broadband connection this won’t take long. Next upload to the new host server. This took about 45 minutes for me. However, I set it up and just left it running. Last, after checking I have shell access with my user on the new host server, I use Putty to do a SSH session and then just run the following command: tar -zxvf yourfile.tar.gz. This unzips everything into the folder you leave the file.

All done in under an hour with about 10 minutes of my actual time.