You have reached the blog of Keith Elder. Thank you for visiting! Feel free to click the twitter icon to the right and follow me on twitter.

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:

  1. Write some custom PHP code to get the data into a format I could import.
  2. BlogML export.  WordPress doesn’t support BlogML at this time so even though I investigated it, I couldn’t find anything. 
  3. Export the data from PHPMyAdmin (mysql database web interface) in some format and then process it into SubText.
  4. Write an SSIS package.

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

Comments (10)

What a great blog, i really like it.

Thanks for taking the time to discuss this, I feel strongly about it and love learning more on this topic. If possible, as you gain expertise, would you mind updating your blog with more information? It is extremely helpful and beneficial to your readers.

hello, this is my first time i visit here. I found so many interesting in your blog especially on how to determine the topic. keep up the good work.

The biggest problem with the conversion AG is that Community Server supports BlogML format but WP doesn’t ( at least not when I made the conversion). If both systems would support the same format there wouldn’t be a problem.

Hmmm. It seems that real problem was that Keith experienced, was that he needed to retrieve data from two disparate blog publishing engines (Community Server and WP).
WP is open and Comm. Server is not. Actually, Open Source tools _did_ help in this situation 😉

Wow, what should be a fairly simple task actually sounds pretty compex. It’s kind of ironic that all of these Open Source system don’t make it easier to convert data back and forth among them.

Thanks for sharing your efforts with us.

Subtext Notes Around The Web

But I think your problem was with sever/machine resources or wrong versioning. I’ve gotten many feedbacks about BlogML converter for CS and none of them had a problem with export unless when server stopped the export progress.

However, I’m glad to see BlogML could help you.

Thanks Keyvan for stopping by. BlogML definitely saved me some time. It would have saved more time if I could have gotten the export from Community Server to work. In hind sight I should’ve just written the PHP BlogML conversion for WordPress so it would be available but time was my main factor.

I’m glad to see BlogML could help you.

Yes, one of our main goals it to adapt other blogging tool with BlogML. The problem is unfortunately PHP guys don’t open doors to the world and just keep things in their limited area 😀

However, a developer inside SubText team contacted me and asked some general questions to work in WordPress implementation but I haven’t seen any result yet. There were some implementations for Blogger Export and they should be possible to apply to MT.

Write a comment