A couple of days ago I started the migration of my blog to the new and shiny Windows Azure Web Sites (AWS - I don’t think that acronym is a co-incidence) and the Orchard CMS platform. The whole reason behind doing this migration is that I felt the need for a more modern (and stable) platform than the one I’ve built from scratch, years ago, and of course that I want to fiddle with some new toys. So, here is a short story on how I did the migration.

Setting up Azure Web Sites

Create a new AWS siteThe first thing was to set up a new Azure Web Sites site. This is done from the new metro-styled Azure portal at https://manage.windowsazure.com/ and all you need to do is click NEW in the lower left corner and select Web Site and then From Gallery. This option allows you to quickly create a web site and at the same time install an App on that site. I chose Orchard CMS, but you can choose from a lot of apps here such as Wordpress, Umbraco, Drupal, Dotnetnuke etc.

The reason I chose Orchard is that I wanted a modern and top of the line CMS and that I’ve been following that project since the Oxite days. It’s based on .NET which also makes it very easy for me to extend it.

Once the App is chosen from the AWS Gallery you need to choose a name (nnnnn.azurewebsites.net) and a Region where to host it. Then you just apply your configuration and wait for a couple of minutes for the web site to spin up.

Using SQL Azure

Orchard allows you to choose from using the embedded SQL or using a separate SQL instance. I decided to use SQL Azure. I did this since that makes it easier for me to move the data from my development environment back and forth and since the Azure Web Sites is in a preview mode - you never now if your data will be gone one day :-)

Configuring Orchard

Once the Azure Web Site is up you will be presented by the Orchard start screen which asks you for information on how to set up Orchard. You enter username and password, choose which SQL to use (embedded or separate) and you will be asked for a recipe (for which I chose the blog one). Click Ok and wait a minute or two and your Orchard site will be prepared.

Migrating content

The first thing I did was to start migrating content - the blog posts and all associated images. Since I had my own home brew blog CMS I created a small tool that exported all the data from my old site to the BlogML format. That gave me a 7MB XML file with all posts and comments. The next thing I did was to move all the images from the old system into Orchard. This can be done in Orchard using a very convenient method where you upload zip files with your images. I had some issues with the file size, so I had to move it in smaller chunks of max 5MB at a time. The URLs for my media did change when I uploaded the images and files, so I used a text editor and replaced all the paths in the BlogML file to the new paths.

BlogML importOnce all media and files were uploaded I started importing the BlogML data. I added the BlogML module to Orchard which extends the admin interface with BlogML import and export functionality. I had to split my BlogML file into smaller chunks, since it would time out on me if I used to many posts/comments at a time. One reason that I got a lot of timeouts was that I had a lot of comments (approved and unapproved) in my BlogML file and all those were verified using Akismet spam check during the import. The BlogML import feature uses the Orchard Alias function, so all URLs are preserved.

Other Orchard Modules

Once I had all my content in Orchard I added a couple of extra Modules to Orchard. These are the ones that I have added:

I have also added a couple of search/index modules

There is only one problem right now with modules in Orchard on AWS (I think it’s related somehow, since I don’t get the same issues/timeouts in my dev env), is when you activate/install a Module your site becomes unresponsive for 5-10 minutes.

And a custom Theme…

The only customization so far is a custom theme that you can see right now. It’s based on the TimeMachine Theme.

Going Live

Once the site was all ready I updated the DNS (which I have in Office 365) with a CName pointing to my Azure Web Site. But in order to get AWS to accept my domain name I needed to add a hostname to the web site. Unfortunately this feature is not available when you’re using the Shared Web Site Mode, so I had to switch to the Reserved Mode - which of course starts the billing clock…

Reserved Mode

Then I did some final configurations like mapping my FeedBurner feeds etc and my site was up and running.

Summary

A quick walkthrough on how I got my blog moved to Azure Web Sites, SQL Azure and the Orchard CMS. As you just read it was an easy ride, with the only obstacles that I had to upload data in chunks and could not use the Shared Web Site Mode. Now let’s hop that AWS don’t have to many hiccups…