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.


    • 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.

Leave a Reply

Your email address will not be published. Required fields are marked *