Migrating from Orchard CMS to WordPress using Windows Live Writer

OrchardLogo_200x200For the last 4 years or so, I’ve been hosting my blog/site using Orchard CMS. Orchard has been a pretty good platform. It offers a great deal of customization and extensibility points, and for .NET developers it can be a nice place to start for building an application. Unfortunately, whether because of my own customizations or some other reason, I ended up stuck on an older version of Orchard, and despite many hours of trying, could not get the site updated to a newer version. So I decided to move the site to the WordPress platform.

Wait…aren’t you an ASP.NET Guy?

Well, yeah. But here’s the thing. What’s important to me about a blog isn’t what platform it’s running on. It’s how quickly I can do what I need to do. Post updates with Windows Live Writer, customize with an attractive (and high-performing) theme, add functionality through plugins. While Orchard has themes and plugins, WordPress has a much larger ecosystem of them. And WordPress works great with Windows Live Writer. Although I don’t expect to ever become a PHP guru, I can also certainly manage to do the occasional code tweak as needed.

Start Migrating

My initial hope was to find an automated way of getting my Orchard content moved over to WordPress, but in that I was stymied. Despite extensive searching, the closest I was able to find was someone who had created an Orchard module to move his blog to Mads Kristensen’s nifty miniblog platform. While I suppose I could have attempted to modify that code for my needs, I decided against it, because the code would have ultimately been completely throw-away, and the potential for spending a great deal of time was large.

After some pondering it occurred to me that one possible solution was to use Windows Live Writer to perform the migration, one post at a time. Yes, this would be pretty tedious, and it would be terribly impractical for blogs with a ton of archived content, but after a recent cleaning up of old posts on my blog (mostly announcements about long-past events, and app promotion posts from my days at Microsoft), I had fewer than 200 posts to worry about, so I decided to do a test to see if the process would work at all.

So I quickly spun up a test instance of WordPress on my Azure account, and added it to Windows Live Writer (I’ll do a step-by-step walkthrough in a future post). Then I opened an old post from my Orchard blog, and switched WLW to point to the new WordPress blog, and clicked the Publish button. And voila, the post appeared on the new blog!

Not So Fast, Buster!

OK, so of course it couldn’t be THAT easy. One of the tricky aspects of the migration is that many of my blog posts had embedded images, and most of these were stored in my Orchard media library, so if I simply re-published the blog posts as-is, the image links would work only so long as the old blog was still online. Not good.

This problem, however, presented an opportunity. With a simple plugin, I could host all of my images on Microsoft Azure Storage, and centralize image handling, and offload them to another site. And as a bonus, if I ever need to move things around, the links to the images don’t have to change again.

The Long Slog

Actually migrating the posts wasn’t particularly hard. Just time-consuming and a bit tedious. After setting up the actual WordPress instance I planned to use for the final location, and getting the Azure Storage plugin set up (as well as an automatic image smushing plugin), I added the new blog to Windows Live Writer, and started migrating.

Posts without images were easy. Just open the post from the old blog using WLW’s “Open Recent Post” menu item, and then switch to the new blog and publish. Post with images required some additional steps. I had downloaded a copy of the site code for my Orchard install, which included all of the images for all posts, so for each image, I would re-insert the image and tweak the layout as needed. This gave me the opportunity to resize some pictures to their original size, and allow the responsive theme I’m using resize as needed. Once all the pictures were done, it was time to publish, and check the post on the new site.

The entire process took me around 2 days, which seems like a lot, but compared to the time it might have taken to write and debug custom code for doing the migration, I think it was time well-spent, particularly since my images are now all hosted in Azure and have all been optimized (and any new images will be likewise).

logo-wordpress-200-200Moving Forward

There are still a couple of pain points to resolve (separating the good plugins from the bad ones, for example), but overall I’m very happy with the end result of the migration. As noted above, I don’t know that using Windows Live Writer as a migration tool is the right choice for everyone, and I’m certain it’s not what it was designed for, but it did the job for me. For those who might want to give it a try, I’ll write up a detailed walkthrough of the process in a future post.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.