in Technology

Transferring sites from one server to another using FTP

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!

Write a Comment

Comment

  1. I wanted to use rsync, but it wouldn’t support FTP! And after using lftp a couple of more times after yesterday, I am liking it! It’s pretty neat!

  2. You can use a program like lftp, rsync, sitecopy – or simply FTP to transfer files. But I am not sure if you had scripting done with some Yahoo! specific language. I don’t know what Yahoo! is using for scripting now, should be PHP, but earlier their ecommerce solution etc had some Yahoo! specific things that wouldn’t work on other hosts unless ported.