Migration to WordPress

As I mentioned, I’ve migrated my blog to WordPress. All in all, a pretty easy transition, but there was a lot involved. For the benefit of those contemplating such a move, I thought I’d write some notes here…

Linux hosting. Up to now, I’ve done all of my hosting on Windows, and NewsGator’s data center (where my old blog lived, on server #1) is all Windows as well. I couldn’t find any instructions as to how to install WP on Windows, so I switched my 1&1 hosting account (which hosts http://www.gregrphoto.com) from Windows to Linux. Kudos to 1&1 for making that transition seamless – especially since I’m only paying $3.99/mo for my account. :-) Making this transition also gave me access to MySQL, which I needed for WP.

wordpressicon-hanttula2.gifInstalling WordPress. I have to tell you, I was blown away. This was my first time hosting anything on Apache, and my first time touching MySQL…but it all just worked. So easily, in fact, that I didn’t really believe it was working at first. All I had to do was a) create the database, b) update a config file with the database location and credentials, c) copy the WP files to my site, and d) navigate to an “install” URL. This part took literally maybe 5 minutes. Kudos to the WP folks for making this so easy!

Content migration. I had hundreds of posts and thousands of comments in my old blog, stored in a SQL Server database. I wanted to migrate these over as seamlessly as possible. After quite a bit of research, I decided to write an application to create a file in the Movable Type export format, and import that into WordPress with the MT import option. After a few test runs with small files for testing, I got a format that would work consistently. I also had to import in small chunks (around 90KB each) rather than importing the whole file at one time. (aside – thanks JeffT for building this app for me!)

Maintaining URLs. My old blog got thousands of hits per day from people coming from search engines and the like, and I wanted to make sure these old URLs would still work. My old permalinks were in the form:


Where the “811” was the ID of the post in the old SQL database. The new post in WP has a very different URL:


I did two things to get these old URLs working:

1. Built a PHP file called “archive.aspx”, which would look at the post ID passed in, and in turn redirect to the new URL. This is done via brute force (a big long “switch” statement), and that statement was auto-generated by another application. (thanks again Jeff!)

2. Added a line in my .htaccess file to map the .aspx extension to the PHP processor.

This part wasn’t perfect – I’m still fixing a couple of the redirect URLs – but it made 95% of them work the first time. And it’s not the most efficient way to do this, but it works for what I need.

So…all in all this took about a day’s work. 5 minutes to install WP, and the rest to take care of the migration stuff. But I’m back!

7 thoughts on “Migration to WordPress

  1. Nick Harris

    Come on Greg! I had WP running on my dev box (Windows) for a long time while I was working on the WordPress and Publisher plugin’s for Inbox.

    It is really easy to install – better than Moveable Type but not as easy as CommunityServer… if I remember right.

  2. Andrew

    Hey Greg – great minds (er, ok, ) must think alike!

    I did the same with my major site – I still use blogger for the main blog site but my actual business site is now running on WordPress as my entire CMS.

    I too found the entire process fairly easy.

  3. iainlbc

    Hi Greg,

    This post is a bit old but I had some light to shed on the topic if you don’t mind.

    To handle URL Redirection (post-migration) I choose to install the “Redirection” Plugin. The best part about it for anyone looking to do a migration is it logs all 404 errors and gives you an easy way to make rewrite rules from a front end GUI.

    While its advisable to implement a redirect strategy before moving over and causing thousands of 404’s, its a great way to catch and fix 404’s that were not prevented in the original plan.

    A perfect example of this is there were thousands of 404’s logged of people hitting our old MT Search engine. With Direction and some simple regular expressions I was able to redirect all of those search queries to the new wordpress search engine without getting my hands dirty.

    Examples shown in more detail here:


Leave a Reply