WordPress based blog

Sunday, May 1st, 2005 at 10:16pm

The new month brings change as this weekend I finally got around to migrating my blog over from my homegrown solution to WordPress as I mused about back in March.

The biggest task involved in the migration was the creation of a theme so the look and feel of the blog could largely remain the same. The biggest change is that there is now a sidebar on all the blog related pages with links to the monthly archives. This has also been the most painful task as although the WordPress templating system may use PHP it does not relate to any half decent programming practives. Each ‘tag’ in the templates is actually a PHP function and some of them print a string, some of them return a string, and some of them have an argument to say whether they print or return. Don’t get me started on everything being global…

At first I thought I would have to write some code from scratch to migrate the existing entries into the WordPress tables but I was pleasantly surprised when I found that WordPress comes with a RSS import script. I did have to modify the RSS generator in my old blog to both include all entries as well as the complete text of each entry but that was fairly trivial which allowed my to discover a bug in the import script. WordPress stores two dates with each entry, the date in GMT/UTC and the date with the desired offset, and in the import script these were back to front which meant that all my posts were imported with a date twenty hours different. This was fairly straightforward to correct and I suppose that I should contribute my changes so no one else has this problem.

The final task involved in the migration was to insert some rewrite rules to redirect requests for my old blog over to the new one. Initially I was going to lookup the old style 12 digit time/date string in the database to determine the exact url to redirect to but I realised that they were wrong anyway because of when I changed back from daylight savings (I’m not going to bother with that in the future) so instead I just extract the date and redirect to the appropriate day archive. The only time this will fall down will be when I posted close to midnight…

My next task (well the next task related to my blog) is to get the trackback functionality up and running and after that are investigations into the numerous plugins that are available…

Tagged with: ,