Archive for the 'duplicate' Category

Transferring sites from one server to another using FTP

nirav April 10th, 2007

We had to duplicate one site on another server today. And we had only FTP access to both the servers. The last time I had to do this, I used “mget” to download all files and folders from one server and then used a script to upload them to another server. It was a pain to create all the folders myself, and the script I used broke on certain file names.

So I wanted something better this time. Tried to hack up the script a bit, but did not have enough time before the go-live. Did some Google, and found out “lftp“. The command line linux tool is amazing! It does a lot of things! To download all the files from one server, I simply had to use the mirror option with source and destination folders. And to upload them back to the new server, I used the same option, but with a -R switch to reverse the process and upload files instead of downloading.

I wish I found this earlier!