How to Migrate Blog Post Images from BlogEngine to WordPress

June 24, 2009 · 7 comments

I recently migrated my entire blog to a new host and a new blogging platform. While doing the transition, I took notes, analyzed my options and made the jump from BlogEngine to WordPress just last weekend. This post addresses one problem I encountered along the way.

One problem I encountered while performing migration tests from BlogEngine to WordPress were the image references in the posts. Left unaccounted for, any post images on WordPress after the migration will be using a reference that was good for BlogEngine but fails for WordPress. So something needs to be done to them unless you don’t mind redoing each and every post that contains an image in it. I know I don’t want to waste that time, so here’s how I worked around this little problem.

The Problem

In BlogEngine image references look like this:

domainname/image.axd?picture=WindowsLiveWriter/some-folder/some-image.jpg

In WordPress, an image reference looks like this:

domainname/wp-content/uploads/2009/06/some-image.jpg

After you migrate your blog from BlogEngine to WordPress using the BlogML import tool in WordPress, all images will be referring to image.axd and not wp-content. So how can we fix this problem? Easy, we need to modify the BlogML data file before we upload it into WordPress. So let’s have some fun and perform a little string surgery.

The Solution

There’s an easy fix for this, and all it requires is identifying where the physical images are and modifying the references in the BlogML data file.

BlogEngine stores the image files for posts within the App_Data\Files folder. I happen to use Windows Live Writer, so all of my images went even further into another folder. So why am I explaining all this?

These files will need to be FTP’d to the destination host and placed under your /wp-content/uploads/ folder. You can move these ahead of time and have them sitting there waiting for you to perform the import process. Just grab the root-most folder that contains the images and move them over to the new host.

Once the files are on the new host, give one a test to make sure that you can still access the images you want. Just type in a direct reference like http://www.waynejohn.com/wp-content/blah blah/someimage.jpg into a browser, and it should come up if everything is alright.

Plus, once you have the image reference in the browser, you can refer to it while performing a quick find/replace operation in your favorite text editor. If the domain name is changing, include a quick sweep for your domain name also, as part of the string surgery. Just in case. You never know.

Here are the steps to migrate your BlogEngine post images to a WordPress blog.

  • Find the root image folder and FTP the folder and all it’s contents to the /wp-content/uploads/ folder.
  • In the BlogML data file, replace all instances of “/image.axd?picture=” with “/wp-content/uploads/” in the BlogML file.
  • Perform any other string manipulation operations you’d like to perform in the BlogML data file.
  • Import the BlogML data file to WordPress

That’s all there is to it. At this point you should be able to view your WordPress blog and see that the post images are indeed there and they are pointing to a reference located on your WordPress host. Everything should be looking good, as far as post images are concerned.

If you see any way to make this more effective or easier, let me know. Unfortunately the BlogML does not include the code it would need to migrate the images. At least not that I was able to discern, but I didn’t go digging in it either. Perhaps the process would add too much overhead, but I’m sure there are ways around that.

It would make things so much more easy, and this post completely unnecessary. So I guess I should just keep my trap shut.

Wayne  (531 Posts)

Wayne John is a health coach for people that want to lose weight, gain weight, improve athletic performance, or simply maintain a healthy lifestyle. Wayne has lost over 55 pounds and improves his current health every day by using simple, straight-forward techniques that anyone can integrate into their lives to achieve the same. Contact Wayne today to realize your own health and fitness goals, or get started now by completing and submitting the free Wellness Profile. He also has been developing websites since 1995 and programming solutions for clients even longer. He'd rather be outside having fun in the sun though.


Start a discussion, or join in one

Thank you for taking the time to read this. I encourage people to speak their mind, so please feel free to leave a comment using the comment input form found below.

Karen

Seriously, Wayne, you wear me out. I can barely type a blog much less bo anything with it!

Wayne

Glad to hear it Karen. Thanks for leaving such an inspiring comment. I think I’ll go try to wear someone else out now. My job here is complete.

Adam Donkus
Twitter:

Looks sweet my friend..great job with the transition. Did the link structure change at all?

Wayne
Twitter:

Thanks Adam!

Yup, completely. I’ve made several structural changes and made accommodations for those changes. You’ll see a few more posts like this one that describes a certain facet of the migration. This will all be topped off with a review of the process. Should make for a good 5 post mini-series.

That is, of course, if you are moving from BlogEngine to WordPress, lol

Vanea Bell
Twitter:

:’( Oh!… Is hard… After so much time… I feel like i have no words! How are you my dear Wayne?! Wordpress??… It’s a very big change! If it was in your advantage i congratulate you! But, even so, i feel my heart broken, seeing this ugly theme… :’( I guess that i’m used to see your old and forever alive in my heart, Blog Engine theme… :-( Sorry, Wayne! I guess that i must be very happy for you!… Sorry, also, for my absence from this little world of yours! But, life is changing and i’ve tried to find few friends from my own country… How is Manz?!… Manz… I must go and salute her too…! :’( Sorry for my spelling, worst than ever before… Nice to talk to you!! :-) Your friend, Bell

ikaran

Wayne,

I’m looking to migrate from blogengine to wordpress as well.

How did you fix those blogengine urls that have been crawled by google? I am on IIS7 and PHP5

thanks

Wayne
Twitter:

For every URL that you want to accommodate, you’ll need to specify a 301 redirect. Here’s a nice doc that covers most web servers: http://www.webconfs.com/how-to-redirect-a-webpage.php

Previous post:

Next post: