Migrating a WordPress installation from one server to another

on November 21, 2011 by Programming, Technology, Web Programming & Development with 0 comments

There comes a time when your once fast server needs to be replaced with a superior machine. In fact, this time comes fairly often for system administrators these days. Around here, our developers are also our system admins, so time is at a premium. This means that we stretch the lives our our servers as long as possible to avoid spending time transitioning web applications. On average our dedicated servers have a lifespan of 2 years before we start fresh again on the latest hardware and operating systems.

In this round of upgrades we are also consolidating our servers so that we have just one powerful linux machine and one powerful windows machine to run our 50+ websites. We are migrating most of our wordpress installations to our linux server since PHP application are more at home on a linux box, although several of our wordpress installations will still be living on our windows server to be contained under certain domains.

The process of moving a wordpress installation is fairly straight forward, but it always helps to have a simple step-by-step to work from.

  1. Ensure that nobody will be making changes to your current installation while you’re moving the site.
  2. Create an archive of the current site directory. Under linux, use:
    tar -zcvf your-wordpress-install.tar.gz /var/www/yoursite

    (where /var/www/yoursite is the path to your website)

  3. Download the site archive file using an FTP client
  4. Upload the site archive to your new server and extract it. Under linux, use:
    tar -zxvf your-wordpress-install.tar.gz -C /var/www/yournewsite
  5. Export the MySql database for your site. I’d recommend using the MySql GUI Tools to both export the database and import the database into the new server.
  6. Import the database into the new server.
  7. Set the sites DNS to point to the new server’s IP address.
  8. Turn off the old site to avoid any data consistency issues.
Once the new site is up and running, ensure that the common permission based function are working, namely permalinks and image uploads.
The following two tabs change content below.

Matthew Mombrea

Matt is a longtime entrepreneur and software engineer. He is a founder of Cypress North, and chief technology officer. Matt also contributes to the community as a columnist on ITworld.com.

Leave a Reply