Upgrading and merging of blogs to Subtext
Posted by Keith Elder | Posted in Blog Updates, Internet | Posted on 01-01-2007
Awhile back I mentioned playing around with SubText and DasBlog, two open source blogging engines written in .Net. After several weeks of further investigation I decided to migrate to SubText.
The decision was pretty easy in the end since SubText works with .Net 2.0 and appears to be somewhat architected the way I tend to do stuff. That coupled with the pretty active email list made the choice easier. There are some features that it doesn’t have that I wish it did. For the features it doesn’t have I hope to be able to contribute them to the project.
Before today I had two main blogs:
blog.zorka.com and a .Net blog
Both of these are now combined into one blog on http://keithelder.net/blog/. It took a lot of hard work to get everything merged into one blog and I thought I would outline the process of how things went since I had to migrate a WordPress and a Community Server blog to SubText.
Migrating WordPress to SubText
WordPress is written in PHP and I have been using it for a long time on my original blog at zorka.com. My information went all the way back to 2000 before blogging was even blogging so needless to say I didn’t want to loose it. I had a couple of options that I could go with when I ported the data:
- Write some custom PHP code to get the data into a format I could import.
- BlogML export. WordPress doesn’t support BlogML at this time so even though I investigated it, I couldn’t find anything.
- Export the data from PHPMyAdmin (mysql database web interface) in some format and then process it into SubText.
- Write an SSIS package.
In the end I chose option 3 and 4. PHPMyAdmin allows you to export data in CSV, XML, Excel etc. The one that worked the best for me was the Excel format since SSIS has a built in Excel reader. Instead of writing custom code in .Net, I decided to take this opportunity to leverage SSIS (SQL Sever Integration Services) to assist with the import. After creating a new solution I was able to quickly throw together a Data Flow to take the Excel file which held the blog posts and import it into the SubText database. There were some conversions that needed to be done since SubText has some columns that are required in order to work but in the end nothing that was terribly hard. Looking at some sample articles SubText required 4 additional columns that WordPress didn’t provide so I derived those from global variables after data was converted and verified that I had written the blog post.
Once I got the initial posts imported I had a little bit of clean up to do on some posts because of the way PHP handles characters as well as escapes a lot of quotes. In the end it was easier to search and replace the exported file and replace the characters before the SSIS package ran.
Migrating Community Server to SubText
Once WordPress data was imported I had to get the Community Server data imported. Once again I had four choices and initially tried doing a BlogML export. While Community Server supports BlogML imports and exports via a plugin, the plugin bombed while exporting data for me. I think there was some malformed XML or something in one of my posts that caused it to fail. I couldn’t really tell so I stopped going down the BlogML route and wrote another SSIS package to extract the data.
BlogML Makes It Easier
For those that aren’t familiar, BlogML is a new format that allows you to easily migrate your blog data from one to another. Several of the major blogs support it that are written in .Net and a lot of us are hoping it catches on in other platforms. With all the data from both blogs loaded into the database locally, I copied the SubText files to the server and did a new installation. Once SubText was running on the server I did an export into BlogML and then imported it into the server. Within minutes all of my blog data was on the server. BlogML is really nice when it works and I hope more blog engines start to adopt the format. It saved me from having to backup and restore the database onto the server, definitely much easier.
In the end of the conversion I lost my comments from both blogs. I just didn’t feel like saving them for whatever reason. Hopefully those of you that commented will re-comment. The conversion is complete and I updated my RSS feed to point to FeedBurner as well. If nothing else, if I have to move things around again, you won’t have to change your readers.
I hope you enjoy everything being in one place finally. I know I do.


Deep Fried Bytes