Robert Kern
PHP Web Developer
My name is Robert Kern.
I am a PHP developer from Auckland, New Zealand.
Browse through some of my web development projects, or get in contact with me if you are interested in hiring my php web development services.

Search

  • Topics

    • Honduras (25)
    • Hosting (3)
    • How to (9)
    • iphone (11)
    • Mac (8)
    • Movies (1)
    • Off Topic (10)
    • PHP (8)
    • Recipes App (12)
    • Servers (1)
    • Software (8)
    • Subversion (4)
    • Technology (4)
    • Uncategorized (1)
    • Videos (8)
    • Web Development (20)
      • Security (2)

 

Archives

  • December 2009
  • November 2009
  • October 2009
  • July 2009
  • June 2009
  • May 2009
  • April 2009
  • March 2009
  • February 2009
  • January 2009
  • December 2008
  • November 2008
  • October 2008
  • September 2008
  • August 2008
  • July 2008
  • June 2008
  • May 2008
  • April 2008
  • March 2008
  • February 2008
  • January 2008
  • July 2007
  • Home
  • Web development
  • Storehouse
  • PHP
  • Subversion
  • Projects
  • Contact me
...
  • In Honduras
« Use PHP to make alternate coloured rows
Project Management and the Developer »

Move data from one web server to another using wget

Home > Hosting > Move data from one web server to another using wget

Recently I needed to move a large amount of data from one web server to another. I was moving about 50 websites to a new server. I didnt want to download all the data via FTP and then upload it to the new server (especially not from here in Honduras where the Internet isnt as fast as I would have liked). I didnt have SSH access to the old server due to shared hosting security issues. How did I move it all in only a few minutes?

I had asked the host for a backup of my home directory which contained the data for all the sites. Due to some annoying permissions problems, the backup they provided me didnt contain all the files (which I discovered as I begun doing the scheduled transfer). The timezone differences meant that while I was working at a comfortable 8am, the time in NZ was around 2am. I couldnt ask for another backup and expect to have it in time, so I had to think of a better way.
Then I remembered wget. An amazing Unix tool that I use very often. I usually only use it for http requests, and had forgotten it could do ftp as well. So while I didnt have SSH access to the old server, I did have FTP access. I used the following wget command to log into FTP and download every single file under my home directory to the new server (which I did have SSH access to as it is a VPS that I own):

wget -r -N -l inf ftp://user:pwd@ftp.example.com/foldername

Within a few minutes (the two servers were both based in Auckland and the transfer speed was incredibly fast) all the data had been transferred across. I only had to re-organise the location of the data to the appropriate places, backup and import the MySQL databases to the new server and wa-la it was done. Thankfully, the 50-odd sites are running on the Frondiz CMS which means that the installation on the new server was very quick (ie, I didnt have to setup 50 different sites in apache, just a few, one that contains lots of domain names).

Related posts:
  • Backup folders to Amazon S3 automatically...

Tags: MySQL, PHP, wget

This entry was posted on Friday, August 29th, 2008 at 4:00 am and is filed under Hosting. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

2 Responses to “Move data from one web server to another using wget”

  1. Walter Schulze » wget Says:
    September 12th, 2008 at 8:12 am

    [...] Robert Kern [...]

  2. Walter Schulze » Unix Command: wget Says:
    September 14th, 2008 at 5:49 am

    [...] Robert Kern [...]

Leave a comment

© 2004-2010 Robert Kern, owner of Frondiz, need Hosted Subversion? | Design by Jarred Bishop | WordPress