Those looking for ASP.NET-driven blog engines will have a similar experience as those seeking ASP.NET driven discussion boards or Wiki applications: The choices are few and far between, and newer projects are rather immature and buggy. Compare this to the offerings available on the LAMP/PHP stack (WordPress), or even for CGI/Perl (Movable Type), the options are much more mature and varied.
The Problem with ASP.NET 2.0
All the while PHP developers have taken the move to PHP 5 in their stride (with a one year head start over ASP.NET 2.0) and they now have quite a mature platform which they can bring to bear against ASP.NET’s technological superiority and feature-richness. With The Ruby on Rails ”innovation” is also going more slowly, especially with fewer big announcements, which soothing for developers.
Right now ASP.NET looks more and more like the new J2EE. And not in a good way.
ASP.NET 2.0 Blog Engines
DasBlog is still the primary ASP.NET blog engine and is now under more active development than it had been in the past. An ASP.NET 2.0 Medium Trust compatible version should be available REAL SOON NOW. As for other choices, .TEXT was incorporated into Community Server and forked into SubText.
For want of Medium Trust in the best engine DasBlog I had been using ThinkJot (a controversial DasBlog fork) since the start of this blog and was quite content with it. I’m just missing the modularity, maturity and community support of the most most prominent blogging app on the market, which is WordPress. Yep, and the prettiness of the themes didn’t make this choice any harder…
Wanting to stay with an ASP.NET offering at first I had a look at Blogengine.NET and found it promising but a little immature and spotty in support of Unicode. However, development of this project is going rapidly so you might wanna check it out. There is another project out there, an ASP.NET blog engine driven by Subsonic which sounds like a good match. However, the project is not nearing completion as of now.
Making the Move to WordPress
So, back to WordPress. As my hosting provider Crystaltech supports MySQL and PHP even on the cheapest hosting plan, I foresaw few issues with the migration and indeed it all went quite smoothly.
Here are some pointers as to the procedure I would recommend:
- DO NOT DELETE or modify your old blog, rather back it up with FTP to your local machine.
- Download WordPress and unpack it into a directory on your local hard drive (such as C:\Wordpress).
- Create a MySQL database to host the app on your remote (hosting) server.
- Download SQLyog if you haven’t already done so do manage and monitor your remote MySQL database. The community edition is free.
- Edit the <Wordpress>/wp_config.php file to reflect the connection information of your remote database.
- Upload all files in the WordPress directory to your remote web server. YOU DO NOT have to upload the files to the root directory, it might be more maintainable to create a directory on the remote server, name it /wordpress or sth. and upload the files to this directory.
- Run /<install dir>/wp_admin/install.php which will guide through the installation in just two steps. It is essential here that the e-mail address you enter exists and is registered with your mail server. If the address does not exist, the installation will abort without any verbose error message and you’ll have to start over, dropping the tables from the database (using SQLyog) etc.
The table structure will look like this in SQLyog:
- The installation will generate a password which will be displayed in the browser in step 2 of the installation. Note this password.
- You can now configure your application at <blog path>/wp-admin/, especially this process if you haven’t uploaded the WordPress files to your root directory and still want the blog in your root.
Working with Windows Live Writer
Read this first, before you import your data! Aside from Blogjet, the blog editor with the most promise these days (for the Windows platform) is arguably Windows Live Writer. Since the Beta 2 version which is snappy and feature-rich at the same time, everybody should check out this app. It’s free too. Then again it’s still Microsoft software which causes problems as usual…
After a few trials importing my data I actually thought I had a WordPress bug on my hand. Of course it wasn’t, the problems the problems were caused by a Microsoft app, Liver Writer. The usual suspects…
There are (at least) two issues with the Live Writer/Wordpress match that you should be aware of before importing your data.
The first is the Unicode support. Live Writer supports Unicode (UTF-8) as do PHP and MySQL, but Live Writer has an issue with needlessly prepending a byte-order mark:
Here is the workaround:
Non-ASCII characters render incorrectly on UTF-8 encoded blogs
Description: On WordPress 2.1+ and PHP versions older than 5.0.2, publishing posts using Writer results in non-ASCII characters showing up as either squares or question marks.
Reason and Solution: Writer erroneously prepends the UTF-8 Byte Order Mark to XML-RPC requests that are UTF-8 encoded. This prevents WordPress from correctly detecting the UTF-8 encoding declaration, so ISO-8859-1 is assumed instead.
Run regedit.exe and find the following key: HKEY_CURRENT_USER\Software\Windows Live Writer\Weblogs\<your-blog-id>
Verify that the subkey ManifestOptions contains a characterSet=”UTF-8″ value. If so, under the subkey UserOptionOverrides, add a new String Value named characterSet and leave its value empty.
The second issue is with Live Writer throwing an ArgumentOutOfRangeException when you try to load posts which contain <pre>,<script> or <style> tags that are not upper-cased. More information is here. So follow the steps I outlined below for importing from an RSS feed to avoid this issue.
Importing your Data
With the above issues in mind, you can start importing your data.
Please note that this procedure is based on RSS export and therefore does not import comments. You might have to use BlogML to achieve this. The process is probably: Export from DasBlog and save as BlogML (XML) with the exe downloaded here, then convert to WordPress WXR format with XSLT, and import.
To export/import via RSS proceed as follows:
- In your DasBlog/ThinkJot settings increase the number of items in your RSS feed to cover all the posts:
Max. Days in Main RSS Feed**
Max. Entries in Main RSS Feed
- Load the RSS into your browser by clicking on the RSS icon on your blog home page or by entering navigating to http://<blog url>/SyndicationService.asmx/GetRss
Save the XML displayed in your browser into a text file on your local drive, like c:\wordpress_export.xml
You have to edit the file now For most users, Word is probably the most appropriate application, because now end-of-line characters have to be removed, otherwise they will be transformed into line breaks during import into WordPress, messing up the layout.
- Take the following measures:
- In MS Word>Edit>Replace>More>Special>Paragraph Mark -> Replace with nothing (empty string). This leaves all HTML line breaks and paragraph markings intact but removes the invisible “\n” at the end of some lines.
- Then replace two spaces with single spaces repeatedly to have only one space between words.
- Then look for <pre>,<script> or <style> tags and upper-case them, i.e. <pre> becomes <PRE> etc. If you’re using a code plug-in for Windows Live Writer, these might be the source of many of those tags. I’m using Steve Dunn’s Code Formatter Plugin which I like best. This plugin as most others use the <pre> tag. So upper-case it. Remember to save the edited file as plain text, not in doc or HTML format.
- Then you can import your file into WordPress:
In the Admin Dashboard of Worpress, go to Manage>Import or directly to <blog url>/wp-admin/import.php
Click the RSS-link, browse to the file you edited above and click the “Import File and Upload Button”. This should import your old posts just fine. You can now load the posts into Live Writer with Recently Posted>More.. If it still bombs with an ArgumentOutOfRangeException you can edit the offending post in the WordPress interface upper-casing the said tags and then try again.
To conclude, what took me a number of hours (as usual mostly due to Microsoft bugs [in one of their best products though]) should take you not more than an hour or so. Hope it helps.