You may have noticed the new look of my blog with a bit difference in URLs, as I have migrated from Blogger to WordPress that is hosted on IIS deployed on Microsoft Windows Azure.
Objectives:
- Migrate all posts from Blogger to WordPress
- Don’t end up with broken links for blog posts
- New home page, simple and improved responsive layout
- Update DNS settings to set adilmughal.com to new site
Migrating Earlier Blog Posts
After creating a new WordPress site from Websites gallery in Windows Azure Portal, migrating earlier posts was very easy and straight forward, a tool comes out of box with WordPress, just utilize the tools to import blogger post and comments on WordPress
There is a great tutorial on how to create a WordPress website on Azure in few clicks
Dealing with Broken Links
First, I wanted to move all my blog post with URL like {domain}/blog/{year}/{month}/{title} which is not really default in WordPress, however you can set it under Settings -> Permalinks. The thing I was worried about is that earlier my URL were of scheme {domain}/{year}/{month}/{title}.html and I don’t want to break any URL previously linked blog post. So for this I need to create a custom structure under Permalinks.
However, after setting custom structure, you would end up in URL like:
https://www.adilmughal.com/index.php/blog/2013/02/asp-net-mvc-4-redirects-incorrect-login-url-login-aspx/
To kick out index.php, you need to do some URL rewriting in your web.config, if hosted on IIS. This is pretty much explained in an article “Enabling Pretty Permalinks in WordPress“. Also refer to gist, code snippet, below containing “Main Rule”.
Second, blogger has convention of url scheme ending with .html. I want to get rid of .html but at the same time if I don’t want to break any previous linked blog post. For instance, a blog post link
www.adilmughal.com/2013/02/restoring-nuget-packages-for-external-dependencies.html
should take me to new URL
https://www.adilmughal.com/blog/2013/02/restoring-nuget-packages-for-external-dependencies/
Therefore I have to add another rewrite rule. “Remove html” rule demonstrates the same in gist below:
https://gist.github.com/adilmughal/6388876
It took a little time to figure this out but I believe that was the most important thing. Another thing I want to preserve was social media interaction like Facebook Likes, Tweeted etc. But that is something I was not able to achieve that as such they don’t work on redirection… however what matter most was done.
Home Page and Improved Layout
Previously my home page was merely list of posts, I wanted to add a new home page with a good snapshot of everything like recent blog post, recent talks etc… and that was one of the reason I went for a separate /blog link setting. WordPress and a custom theme gives me flexibility of adding a static page with as home page. I would like to dive deep into the PHP thing to make most of it, but that’s a thing to do later.
DNS Settings
Well that was a bit tricky for me. For DNS settings, first you need to set A (Host) and CNAME (Alias) with Host @ pointing to your IP of server on Azure.
You can find the IP of your server in “Manage Domain” under “Configure” section of your Web site on Windows Azure Management Portal
Second, you need to add CNAME entries to awverify.{website_name}.azurewebsites.net as screenshot depicts below:
Then all you have to do is to add your domain name in “Manage Domain” section
and that’s it. I am done! Enjoy reading my new blog and feel free to provide any feedback. If you are already hosting your blog/site somewhere else, try hosting it on Azure, it has it’s own benefits.
5 Comments
taimoor mirza · August 30, 2013 at 4:38 pm
hmmmm nice
Ayesha · August 31, 2013 at 8:26 am
Great Adil 🙂
Love the new look of your blog 🙂
Nataliya Bogdanets · May 18, 2015 at 8:35 am
Just wanted to add about my experience of using online converter (CMS2CMS). Being a total non-tech – I’ve been surfing the net for several days to find a tool to get the job done. I followed this tutorial http://goo.gl/UM0ieZ and managed to switch to WordPress within less than half an hour. Hope, it will help somebody to save time and effort.
P.S. though its a commercial tool – the prices are very reasonably priced (in my case it was $39).
Tips to Optimize WordPress Hosting on Azure · September 15, 2013 at 11:44 am
[…] months ago, I moved my blog to WordPress on Azure. I am not a WordPress expert, not even near to it but as hosting is charged or free for limited […]
Moving Blog to Custom VM hosted on Windows Azure | Adil's Tech Weblog · November 9, 2013 at 2:31 pm
[…] months ago I migrated my blog from blogger to self hosted WordPress on Windows Azure. My initial experience was good, having a website hosted on azure standard instance with MySQL […]