Greg Reinacker’s Weblog

Musings on just about everything.

Archive for November, 2007

Migration to Wordpress

November 29th, 2007 by gregr

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:

http://www.rassoc.com/gregr/weblog/archive.aspx?post=842

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

http://www.rassoc.com/gregr/weblog/2007/09/28/iphone-and-

exchange-server/

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!

Category: Uncategorized | 6 Comments »

And the blog moratorium shall end

November 29th, 2007 by gregr

So as you’ve undoubtedly noticed, I haven’t been blogging much lately. But this time, I actually have an excuse. :-)

One or two of you might recall that back in December 2002, I built my own weblog server. The reasoning behind this, at the time, was a mix of being fed up with my previous tool, and also that I wanted to have the flexibility to experiment with what were, at the time, new technologies like trackbacks and pingbacks.  It was all built with .NET and SQL Server.  Ah, good times.

Fast forward to 2007…things with my aging blog weren’t so rosy any more, as it had been neglected for quite some time. There weren’t any standard posting API’s implemented, so standard blogging tools like MarsEdit or Windows Live Writer wouldn’t work. I had some custom APIs for posting, and some tools from way back that would use those APIs to post, but those had stopped working well sometime in the last year or so…so I was basically stuck with posting using a web form that had the world’s least reliable HTML editor.

And to make things worse, if I wanted to upload an image, well, there was no easy way to do that. It actually got progressively worse over the years, until the other day, when I wanted to do this, my operations guys asked if I had the Cisco VPN client installed.  Eek!  That’s way too hard.

So anyway…I’ve switched to using Wordpress, and migrated all of my content over here. If you’re reading this in an aggregator, you’re probably seeing a bunch of old content as well…that’s due to the URLs changing for the posts. But from now on, all should be well.

The Wordpress migration was fairly interesting…I’ll put up another post about that for others who are contemplating something like this.

Category: Uncategorized | 4 Comments »