Marc Lognoul's IT Infrastructure Blog

Cloudy with a Chance of On-Prem


Migrating from BlogEngine.Net to WordPress 3.6 Without BlogML

Introduction

For various reasons, I finally decided to switch from BlogEngine.Net to WordPress.

While many resources can be found on the Internet explaining how to migrate using the BlogML format, I did not want to use that way mostly because of compatibilty problems with the version of WordPress I am using (3.6) and migration problems I experienced, mostly with categories.

Instead, I decided to use plain RSS as intermediate format, since it’s easy to export and modify and finally easy to import in WordPress as well.

Preparation

  1. Look at the BlogEngine.Net Dashboard to have an idea of the number of posts and pages to be migrated, this will help estimating the total duration. For me, it took less than a weekend for migrating 3 blogs with 300 posts and about 50 pages
  2. If you have a web analytics in place, get the stats of the most visits posts, pages and other URL. Let’s says over the last 3 years or so. This will give you hints on where to place the effort to get the better return
  3. If applicable, put on hold engine(s) responsible for publishing your new posts in social networks such as dlvr.it or TwitterFeed
  4. Log in as Admin on your BlogEngine.Net-powered blog then go to the configuration section and increase the number of posts visible through RSS feed to the maximum (something like 9,999)
    BlogEngine.Net Config Screen

Exporting Posts in RSS Format

Visit your current blog on http://myblog.net/syndication.axd and save the RSS feed to a file. If your as geek as me, you may want to it with PowerShell:

$WebCli = New-Object System.Net.WebClient
$WebCli.DownloadFile(“http://myblog.net/syndication.axd“,”C:Tempblog.rss”)

Make sure you keep a safe backup of that file not to have to download it over and over again.

You may want to reset to the previous the maximum RSS feed item increased at 9,999 posts at the beginning of this article

Fixing References to Images (and other Elements)

While BlogenEngine.Net stores image references using a handler (image.axd?picture=), WordPress uses a more usual manner by referencing them directly in the way wp-content/pictures/…

Using any text editor, you can perform a search replace easily.

If the original reference also contains a path representing the date of upload separated by  the escape code %2f (/), you can also perform a search/replace.

For this blog, I used the following search/replace statement:

/itblog-en/image.axd?picture= becomes /itblog-en/wp-content/uploads/pictures/

%2f becomes /

Transferring Pictures (and other files)

Using an FTP Client such as FileZilla, transfer the files from From the App_Data to WP-Content, including picture and other files as necessary

Importing Posts

To properly import the posts from an edited RSS feed, I used the plug-in RSS Importer.

It is very straightforward and if necessary, you can delete all posts and import again until to reach an acceptable quality level.

Migrating Pages

For migration pages, I could not find any other way than re-creating each page in WP and then copy/pasting the HTML content and performing manual fixes where necessary.
On the other hand, this allowed me to restructures page hierarchy at the same time.

Configuring Redirection for Popular or Hard-Linked Posts and Pages

In my case, many blog posts and pages were accessed through referring sites pointing directly to .aspx pages from BlogEngine.Net

To maintain the accessibility to those pages, I used the plug-in Safe Redirect Manager which is also very simple to use: enter the old URL, enter the new one and select an HTTP status for redirect (or 404 if necessary). In this case, I use 302 (Permanent redirection).

Final Touches

Finally, I also had to perform the following actions manually:

  • Change the author from “Admin” to myself
  • Disable comments where necessary
  • Restructure posts categories
  • Fix minor presentation issues caused by theme change

Marc