Tool to convert blogger.com content to dasBlog

Posted by Daniel Moth on Daniel Moth See other posts from Daniel Moth or by Daniel Moth
Published on Fri, 09 Apr 2010 14:33:11 GMT Indexed on 2010/04/09 18:43 UTC
Read the original article Hit count: 691

Filed under:

Due to blogger.com dropping FTP support, I've had to move my blog. If you are in a similar situation, this post will help you by showing you the necessary steps to take.

Goals

No loss on blog posts, comments AND all existing permalinks continue to work (redirect to the correct place).

Steps

  1. Download the XML files corresponding to your blogger.com content and store them in a folder.
  2. Install and configure dasBlog on your local machine.
  3. Configure your web.config file (will need updating once you run step 4).
  4. Use the tool I describe further down to generate the content and place it at the right place.
  5. Test your site locally. Once you are happy, repeat step 2 on your hosting provider of choice. Remember to copy up your dasBlog theme folder if you created one.
  6. Copy up the local web.config file and the XML dasBlog content files generated by the tool of step 4.
  7. Test your site on the server. Once you are happy, go live (following instructions from your hoster). In my case, I gave the nameservers from my new hoster to my existing domain registrar and they made the switch.

Tool (code)

At step 4 above I referred to a tool. That is an overstatement, it is simply one 450-line C#code file that you can download here: BloggerToDasBlog.cs. I used this from a .NET 2.0 console app (and I run it under the Visual Studio debugger, i.e. F5) like this: Program.cs. The console app referenced the dasBlog 2.3 ASP.NET Blogging Engine i.e. the newtelligence.DasBlog.Runtime.dll assembly.

Let me describe what the code does:

Input:
  • A path to a folder where the XML files from the old blogger.com blog reside. It can deal with both types of XML file.
  • A full file path to a file where it creates XML redirect input (as required by the rewriteMap mentioned here).
  • The blog URL. The author's email. The blog author name.
  • A path to an empty folder where the new XML dasBlog content files will get created.
  • The subfolder name used after the domain name in the URL.
  • The 3 reg ex patterns to use. You can use the same as mine, but will need to tweak the monthly_archive rule.

Again, to see what values I passed for all the above, see my Program.cs file.

Output:
  • It creates dasBlog XML files in the folder specified. It creates those by parsing the old blogger.com XML files that reside in the folder specified. After that is generated, copy it to the "Content" folder under your dasBlog installation.
  • It creates an XML file with a single ignorable root element and a bunch of inner XML elements. You can copy paste these in the web.config file as discussed in this post.
Other notes:
  • For each blog post, it detects outgoing links to itself (i.e. to the same blog), and rewrites those to point to the new URLs. So internal links do not rely on the web.config redirects.
  • It deals with duplicate post titles; it does not deal with triplicates and higher.
  • Removes all references to blogger.com (e.g. references to [email protected], the injected hidden footer for statistics that each blog post has and others – see the code).
  • It creates a lot of diagnostic output (in the Output window) and indeed the documentation for the code is in the Debug.WriteLine statements ;)

This is not code I will maintain or support – it was a throwaway one-use project that I am sharing here as a starting point for anyone finding themselves in the same boat that I was. Enjoy "as is".




Comments about this post welcome at the original blog.

© Daniel Moth or respective owner

Tool to convert blogger.com content to dasBlog

Posted on Dot net Slackers See other posts from Dot net Slackers
Published on Fri, 09 Apr 2010 00:00:00 GMT Indexed on 2010/04/09 20:53 UTC
Read the original article Hit count: 691

Filed under:
Due to blogger.com dropping FTP support, I've had to move my blog. If you are in a similar situation, this post will help you by showing you the necessary steps to take. Goals No loss on blog posts, comments AND all existing permalinks continue to work (redirect to the correct place). Steps Download the XML files corresponding to your blogger.com content and store them in a folder. Install and configure dasBlog on your local machine. Configure your web.config file (will need updating...

Did you know that DotNetSlackers also publishes .net articles written by top known .net Authors? We already have over 80 articles in several categories including Silverlight. Take a look: here.



Email this Article

© Dot net Slackers or respective owner

Related posts about blogging