Update: After moving to BlogEngine I started getting a large amount of spam comments. I went through the trouble of implementing captcha and I outlined the steps here.
I recently went throught he painstaking process of migrating my blog from Blogger.com to BlogEngine.NET. Here is a brief walkthrough of the process:
- Export the blogger site to BlogML using Aaron Lerch's Poweshell Script. The powershell script produces an XML file which you can use to import all of your posts into BlogEngine.NET through the settings page.
- The BlogEngine.NET uses a concept called SLUG which is a relative URL. So if you write an article named "The Chistmas Story" it will produce a relative url of ~/post/the-christmas-story.aspx . Unfortunately the Blogger engine works differently. It removes certain words and punctuations from the URL string. In Blogger the same article would have a relative url of /2009/12/christmas-story.html. You will notice a few main differences here, Blogger uses the year and month as the initial part of the URL whereas BlogEngine.NET uses the path ~/post. Also Blogger removes certain words like "the" and has an html extension instead of an aspx extension. Therefore, after the migration you will want to repair your links so people can still find your articles using the old URLs. The best way to do this is to add some custom code to your error404.aspx.cs page. Basically, when someone tries to access a post on your site using the old Blogger style URLs they will get redirected to the error page. The code in the Page_Load of the error page will then attempt to re-translate the url into a BlogEngine.NET path. In my case, I used a regular expression to find any requests that were looking for 2009 blog posts (because this is the timeframe that I had a Blogger site):
protected void Page_Load(object sender, EventArgs e)
{
string pattern = @"/2009/\d{2}/(?<oldPath>.+).html";
Match m = Regex.Match(Request.Url.ToString(), pattern);
if( m.Success) {
Response.Redirect("~/post/" + m.Groups["oldPath"].Value + ".aspx" );
}
...
I also did a lot of manual updates to the articles making sure the SLUGs were correct. So if the old URL was /2009/12/christmas-story.html the proper slug for the BlogEngine would be christmas-story. For this part of the project I leveraged google and did a search for all articles on my site using the search string "site:codecapers.com". This produced a list of all the articles previously posted on my site. I then went through each search result, and updated the SLUG to match the old Blogger URLs.
- For some reason the powershell script did not maintain my Tags, so I had to go through my articles are re-tag them. I also used this as an opportunity to clean up some HTML and to replace some images that I did not like.
The whole process took about 2 days. If I had more than one year of articles I probably would have taken the time to expand on Aaron's powershell script. However, the overall process was not too bad and I am extremely happy with the end result. I am truly impressed with BlogEngine.NET and since I am a .NET developer it is really easy for me to make changes and customize everything to my hearts content.