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.
Installing 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!