Migrating from Haloscan and Blogger to Wordpress

Earlier this year, I was informed that Haloscan would be shutting down.  When I created my blog in 2004, Blogger didn’t support comments.  So I set up my blog to use Haloscan’s comment functionality.  Strangely enough, four days later I received an email announcing that Blogger would be shutting down the functionality to publish blogs via FTP, which is the method that I used.  They say that this method only represents about 0.5% of Blogger users, but as one of those one half percent I am annoyed by their decision.  The alternatives were to change to a Blogspot blog or use what they call a Custom Domain, where the blog is hosted on Google’s servers to which you point your domain.  I liked neither of those options because I have my own domain and hosting.  Therefore, due to Haloscan’s closing and Blogger’s changes I decided to install a blog application on my own hosting account.

I looked at a number of blogging applications on opensourceCMS.  They have demos set up where you can use a live system, which makes comparing applications easier.  I decided to go with Wordpress.  I was also looking at Movable Type as it supported static page creation, which is the model that Blogger used.  I heard that Wordpress was a lot easier to work with than Movable Type.  Plus, there is a plug-in for Wordpress (WP Super Cache) that will handle static generation of pages for increased performance if I want (not that I expect that much load on my site).  Installing Wordpress was simple enough: unzip wordpress into a directory, create a database, point the config file to the database, and load the index page.  On the other hand, migrating from Haloscan and Blogger to Wordpress was not as effortless.

Even though both Blogger and Haloscan have an export functionality creating an XML file, neither of these files is supported for import into Wordpress.  There is support in Wordpress for importing Blogger data via the Blogger API, but it didn’t work at first and there still wasn’t a way to get the Haloscan comments into either Blogger or Wordpress.  So it became apparent that I would have to improvise to achieve a solution.  Thanks for nothing, Haloscan and Blogger.  In order to illustrate how ridiculous this process became and perhaps to help anyone facing the same problem, I have included the steps I had to take to migrate from both Haloscan and Blogger to Wordpress.

  1. Install Wordpress:  This is the easy part of the process and no further elaboration is needed.
  2. Temporarily convert to Blogspot:  Wordpress supports importing Blogger data, but it is not able to import blogs that use FTP publishing, which is what mine used.  This doesn’t make any sense as the post data is in their database regardless of the method you use to publish the data.  So, in order to use the import feature, I had to convert the blog to a Blogspot blog so that the Blogger API could export the data to Wordpress.
  3. Import blog into Wordpress:  Once the previous step was taken, importing the post information into Wordpress can be done by clicking Import in the Tools menu and using the Blogger option.  It would have been nice if they had some documentation describing the requirements for using the import feature.
  4. Convert back to FTP mode:  Converting the Blogger blog back to using FTP publishing isn’t necessarily required, but I didn’t want to leave the old blog on Blogspot.
  5. Export Wordpress posts & import into Access:  At this point, I had all of the posts in Wordpress without any comments.  If I was using Blogger’s comment functionality or if I had been able to import Haloscan comments into Blogger, Wordpress’s import would have imported the comments also.  So, in order to know the post ID in the Wordpress database with which to associate the comments when I import them, using phpMyAdmin I exported the post table from the MySQL database to Excel.  I then imported this data in an Access database.
  6. Export Blogger & Haloscan to XML:  Haloscan used the Blogger post number to link a comment to a post.  So, not only did I need to export the Haloscan comments to an XML file, but I also needed to export the Blogger post data in order to know the Blogger post ID.
  7. Import Blogger & Haloscan into Access:  I used XMLFox to convert the exported XML files into Access databases.  After copying the tables from those databases into the database with the Wordpress post data, I finally had all the data in one place.
  8. Export comments from Access into Wordpress:  As already mentioned, the link between the Blogger data and the Haloscan data is the Blogger post ID.  It would have been nice if the Wordpress import feature had imported the Blogger ID as a custom field for each post, but maybe they figured that there was no reason to make things easy for me.  The only other option I saw was to use the post title to join the Blogger/Haloscan data to the Wordpress data.  This necessitated finding and eliminating any duplicate post titles before beginning the whole process.  Joining these tables together, I created a query to output the comment data in the structure of the comments table in Wordpress.  Before exporting the query results, I had to do some data sanitizing as the Haloscan XML file imported into Access had plenty of characters that needed to be escaped before an import into MySQL was possible.  After that was completed, I exported the comment data to a CSV file, which was subsequently imported into the Wordpress comments table.
  9. Update post count in Wordpress:  After all of the comment data was imported, the posts were still not showing the number of comments even though the comments were appearing when viewing the post permalink.  As opposed to being calculated when loading the blog, the comment count for a post is stored in the post table.  So, I created a query in Access to determine the comment count for each post and assemble a SQL statement to update the comment count for each relevant record in the post table in the Wordpress MySQL database.  After running those update queries in phpMyAdmin, the comment counts displayed correctly and the process is finally complete.

Oh, and did I mention that I had to do that for 3 blogs that needed to be migrated?  Yeah, not fun.  But after all of that was complete, the fun began in customizing Wordpress.  I downloaded a theme I liked, activated, and customized it all in the admin interface.  Since the theme is done in PHP, it is dynamic and allows you do a lot of different things, as opposed to Blogger templates which are in HTML only.  In fact, I am contemplating using an additional Wordpress installation in the root of our site as the content management system for those pages using Wordpress’s page functionality.

5 Comments

  1. Shannon says:

    Why is it that my blog list now doesn’t show when your blog updates?

  2. Heather says:

    You made all these changes yet you blog so rarely…

    • andrew says:

      Quantity is not as important as quality. I only blog when I have something interesting to say or mention. And with the advent of micro-blogging (Twitter, Facebook, etc.), shorter posts that would have been blogged just get sent via a different medium. Also, in an effort to practice programming in languages that I don’t use at work I am constantly looking for personal programming projects (i.e. the reworking of the blog mentioned in this post, Tree Climber (http://andrew.andrewandkara.com/2008/10/tree-climber/), etc.). Additionally, what would it say about me as a geek if I had made no changes and the comment functionality and the ability to create new posts had become broken forever. That’s just sloppy.

  3. Kara says:

    That’s my geek! Continual learning to be the best geek possible. :)

Leave a Reply