Moving Wordpress installation from Windows Server 2003 to Linux

We just finished moving our blog (the one you are reading now) from Windows Server 2003 to CentOS 5. The switch included a couple of steps, but was rather easy:

  1. Install CentOS with Apache, PHP and MySQL. CentOS does install Apache 2.2.3, PHP 5.1.6 and MySQL 5.0.22 by default. Make sure to “yum update” to get the latest stable packages.
  2. Make a backup of all your Wordpress database on the original server. To do this we used the excellent “wp-db-backup“. Just backup all of your tables and download it to your machine. You will then have a backup.sql file.
  3. Create a database in your NEW Worpress server, rename the backup.sql file to be the same as the database and import the backup.sql file with the following command:
    mysql -p -h localhost dbname < dbname.sql
    Now all your posts, comments and all, are imported in the new database and ready to use.
  4. Install and/or copy your Wordpress installation. We are always using the Subversion Wordpress and thus had to checkout the Wordpress installation and copied our plug-ins and themes from the Windows installation to the Linux one.
  5. On Windows we used to have permalinks like “/2008/02/04/mypost”. To make it work on IIS we used a rewrite tool that used the same syntax as the rewrite modul on Apache. To make it work on Linux with Apache we had to do the following:
    1. Enable “LoadModule rewrite_module modules/mod_rewrite.so”
    2. Set the “AllowOverwrite” controls to “All” with: “AllowOverride All” (this is very important or else your permalinks will not work)
  6. Restart Apache with “/sbin/service httpd restart”
  7. Make the needed configuration in your DNS and Apache vhost containers.

A word on Wordpress. We are really just a ColdFusion shop, but the Wordpress package as a whole is really just a convincing offer, independently of the language in the back. I have never seen a blog application that is so full featured and easy to use and setup. The sheer amount of plug-ins and themes are a major plus. Anyhow, back to coding some real stuff in ColdFusion .-)

If you enjoyed this post, make sure you subscribe to my RSS feed!

About this entry