Migrating from BlogEngine.NET to WordPress

M

WordPress FTW! After too much pain with both BlogEngine.NET and GoDaddy hosting I moved this site over to WordPress (on DreamHost) last week.

I’ve been using WordPress and DreamHost for years on my other sites, so it was only a matter of time before my personal blog finally made the move. Recent issues with BlogEngine.NET – including Search and Comments not working after a recent update – were the final straw.

I’d been dreading the work involved to make the move, but it turned out to be pretty easy. I basically followed the steps Merill outlined, with a few tiny additions that I’ll outline below. The process even includes a CSV with the required redirects to add to your .htaccess file, so you won’t lose any hard earned Google juice.

Note that the import only imports posts (ie no pages) from BlogEngine.NET – so make a manual backup of the pages from your site (eg copy the source HTML).

Here’s a summary of the steps:

  1. I’ll assume you have a blank WordPress site set up. Make sure you’ve set the Permalink structure you’d like before you do the import – the import will honour those settings.
  2. Export from BlogEngine.NET to a BlogML.xml file.
  3. Copy all the images from your old blog up to the new blog (eg into the /wp-content/uploads/ directory)
  4. Make some replacements in the BlogML.xml file (eg the images paths – BlogEngine uses image.axd?picture= re-directs that you can replace with the direct path name you used in point 3)
  5. Edit the categories in the BlogML.xml file (you’ll need to replace the GUID-like IDs with the actual category names – both at the top and throughout the file)
  6. Download the wonderful BlogML import script for WordPress by Aaron Lerch (get it here) and FTP it up to your /wp-admin/import/ directory.
  7. You may need to make some changes to the settings if you have a large file. Add these to the start of the BlogML import script just after the require_once(‘XPath.class.php’);
    ini_set("memory_limit","146M");
    ini_set("max_execution_time", "300");
    ini_set("max_input_time", "300");
    These set the memory used to 146M* (up from a default of 8MB) and the timeouts to 300 seconds (up from a default of 30). If you import has errors you may need to up these values even more. My import had 913 posts and took roughly 4 mins (ie 240 seconds). Yours may be more if you have a big site to move.
  8. Import the file in WordPress (from Tools -> Import -> BlogML)
  9. You may discover after the import that some things aren’t quite right (eg image paths), and need to import again after fixing (it took me about 5 imports until I got it all right). Before doing so, you’ll want to delete all the imported posts. You can easily do a bulk delete using the Bulk Delete WordPress plug-in.
  10. Download the CSV file of redirects. Open your .htaccess file and add them in. You’ll need to manually add any category re-directs.
  11. You can then do all the usual blog stuff (updating your FeedBurner feed source, submitting your sitemap.xml to Google Webmaster tools, etc)

Hope that helps. If you’d like any further details, leave a comment/question and I’ll update the post.

* Note: I have a Virtual Private Server on DreamHost, so I can increase my memory to 146MB no trouble – depending on your hosting package, you may limits less than this.

28 comments

  • I concur with Mark, you won’t look back. I haven’t either.

    How did the links in your existing comments on posts turn out? ;) I’d be happy to provide a link to my post on getting the images transferred if you’d like.

    I switched due to GoDaddy’s unlimited web site package failing to take into account that .net sites need their own app space…

  • I concur with Mark, you won’t look back. I haven’t either.

    How did the links in your existing comments on posts turn out? ;) I’d be happy to provide a link to my post on getting the images transferred if you’d like.

    I switched due to GoDaddy’s unlimited web site package failing to take into account that .net sites need their own app space…

  • Thanks Wayne,
    Yes, feel free to add a link to your post if you think it will provide help for readers.
    Links in old BE.NET comments came across fine (both in commentor names, and in the comment text).

  • Thanks Wayne,
    Yes, feel free to add a link to your post if you think it will provide help for readers.
    Links in old BE.NET comments came across fine (both in commentor names, and in the comment text).

  • Hi
    I tried to import the blogml file with my former blogengine.net posts. however it is just uploaded to the corresponding folder: wp-content/uploads/ but the posts are not imported. when i have a look in the directories I see that the xml file has been changed into a txt file.
    Any ideas why?

  • Hi
    I tried to import the blogml file with my former blogengine.net posts. however it is just uploaded to the corresponding folder: wp-content/uploads/ but the posts are not imported. when i have a look in the directories I see that the xml file has been changed into a txt file.
    Any ideas why?

  • Hi Christof.
    Just checking, when you imported the XML file (Step 8 in my list above), in WordPress did you go to:
    Tools -> Import -> BlogML
    If you did it should have walked you through the rest of the process.
    I’m wondering if you did something else?
    I’ll update my list above to make it clearer.

    • Hi Craig
      Yes, I went through the import feature in the WP admin interface. I choose Blog ML, indicated the file and clicked on upload and import. The page was reloaded but then there was only the title Import BlogML. No error message at all. It almost looked like something was missing or not displayed correctly.

      When I checked the filesystem I found the blogml file as text file in the upload folder.

      • Hmmm…
        I checked my upload directories and DID find a copy of the xml file converted into a text file, so that must be part of the process. And also shows that the start of the process is working for you. I’m not sure why it is bombing out for you though.
        Is yours a big file? If so, perhaps you might try trimming it down to a really small sample, just to test the process. I know I had memory issues initially, and had to increase the limits (as per my Step 7). However, my process did show me an error message – unlike yours which doesn’t seem to be saying anything, so this is just a guess.

  • Hi Christof.
    Just checking, when you imported the XML file (Step 8 in my list above), in WordPress did you go to:
    Tools -> Import -> BlogML
    If you did it should have walked you through the rest of the process.
    I’m wondering if you did something else?
    I’ll update my list above to make it clearer.

    • Hi Craig
      Yes, I went through the import feature in the WP admin interface. I choose Blog ML, indicated the file and clicked on upload and import. The page was reloaded but then there was only the title Import BlogML. No error message at all. It almost looked like something was missing or not displayed correctly.

      When I checked the filesystem I found the blogml file as text file in the upload folder.

      • Hmmm…
        I checked my upload directories and DID find a copy of the xml file converted into a text file, so that must be part of the process. And also shows that the start of the process is working for you. I’m not sure why it is bombing out for you though.
        Is yours a big file? If so, perhaps you might try trimming it down to a really small sample, just to test the process. I know I had memory issues initially, and had to increase the limits (as per my Step 7). However, my process did show me an error message – unlike yours which doesn’t seem to be saying anything, so this is just a guess.

  • For some reason I keep getting this error:
    Warning: Invalid argument supplied for foreach() in /home/ringof/public_html/wp-admin/import/blogml.php on line 126

    Warning: Invalid argument supplied for foreach() in /home/ringof/public_html/wp-admin/import/blogml.php on line 133

    Anyone else running into this?

    The file is very small so I am not sure what the issue is.

    Please help.

    George

    • Hi George. Hmmm I can’t think what is causing this.
      Feel free to email me your xml file if you like and I’ll take a look. I suspect it will be something to do with the xml rather than something on your environment.
      But, just to check – are you running this on Apache, or on IIS?

  • For some reason I keep getting this error:
    Warning: Invalid argument supplied for foreach() in /home/ringof/public_html/wp-admin/import/blogml.php on line 126

    Warning: Invalid argument supplied for foreach() in /home/ringof/public_html/wp-admin/import/blogml.php on line 133

    Anyone else running into this?

    The file is very small so I am not sure what the issue is.

    Please help.

    George

    • Hi George. Hmmm I can’t think what is causing this.
      Feel free to email me your xml file if you like and I’ll take a look. I suspect it will be something to do with the xml rather than something on your environment.
      But, just to check – are you running this on Apache, or on IIS?

  • Craig,

    You won a beer. I was giving up while importing from DotNetBlog engine, while I say, let me try to add these lines he suggest …
    ini_set(“memory_limit”,”146M”);
    ini_set(“max_execution_time”, “300”);
    ini_set(“max_input_time”, “300”);

    And that solved the problem.
    Thanks man.

  • Craig,

    You won a beer. I was giving up while importing from DotNetBlog engine, while I say, let me try to add these lines he suggest …
    ini_set(“memory_limit”,”146M”);
    ini_set(“max_execution_time”, “300”);
    ini_set(“max_input_time”, “300”);

    And that solved the problem.
    Thanks man.

  • The post is pretty interesting. I really never thought I could have a good read by this time until I found out this site. I am grateful for the information given. Thank you for being so generous enough to have shared your knowledge with us.

  • Your post is one of the nice posts I have ever read. The conversation itself proved that your article is quite a treasure. Keep on posting more insightful posts.

  • Hello There. I discovered your weblog using msn.
    This is a really smartly written article. I will be sure to
    bookmark it and come back to read extra of your helpful
    information. Thank you for the post. I will definitely return.

About Craig

I'm the co-host of HubShots and the CEO of XEN - helping mid-large B2B companies with their digital marketing and lead generation.

Craig Bailey

Archives

Posts