I just finished a project migrating my blog to WordPress (from dasBlog). In addition, I moved from a traditional hosting environment to Azure. Oh, and after all this time, I’m finally changing my domain name and hosting “Schwammy Says” at www.schwammysays.net! I’ve been posting to my blog since March of 2007. So during this transition, I wanted to maintain all of my posts and not break any existing links to my content.

Here are the steps I followed, as best as I can remember…

Part 1: Set up WordPress on Azure

This part was really easy.

  • Create an account on azure
  • Install WordPressTechnically you are done at this point but there was some more to do.
  • Install plugins. Here is what I am using so far:
    • Askimet
    • All In One SEO Pack
    • BlogML Importer
    • Configure SMTP
    • Easy Contact Forms
    • Google XML Sitemaps
    • Redirection
  • Pick a theme
  • Configure settings
    • Tip: One setting I chose was to block search engines from my site. Of course I will change that once my content is fully loaded and I am ready to go.

At this point the blog is ready to use. If this was a new blog I would be all set. But I’ve got to get all of my existing content loaded up before I make my blog “live”.

  • I initially created my blog as schwammysays.azurewebsites.net. However I want it to just be www.schwammysays.net. That is possible with Azure, but not in the free website version. So I switched over to a shared instance on Azure. In that mode, I’ll be able to configure the domain the way I want. More on that later. The shared instance is not free but since I an MSDN subscriber, I get some free credits on Azure.

Part 2: Migration

  • Research: Mostly this was research on how to migrate from dasBlog to WordPress. I found some great resources including this one which I found very helpful:
  • Data: Copy all content from my current web server to my PC
  • Extract: I used dasBlogMLto extract all of my content into the BlogML format.This is needed because you can’t import the dasBlog data straight into WordPress. However, you can import BlogML data WordPress.
  • Fix links: Next I opened the BlogML file in Notepad++ and updated all of the hyperlinks in my content. Since I was changing my sites URL, I needed all of self-referencing links to be up to date.
  • Now, using the BlogML Importer plugin, I was able to easily import all of my content. Note that it seems some people have a lot of errors doing this export and import from dasBlog to WordPress format but luckily I had zero errors here!
  • Next, using FTP I copied up all of my blogs files such as images, zip files, etc.

At this point, the blog is ready to go. It is styled and has content. Still I need to work out all of the url redirection so I don’t lose existing links to my blog.

Part 3: Redirection

This is the area that I was concerned about since I really don’t know that much about. Luckily my friend Nick Berardi (@nberardi) was there to answer a lot of questions.

One issue I had to contend with is that dasBlog uses a different format for urls then WordPress does. For instance, for a post named “This Is A Post” it would become a url like this:

DasBlog: www.blog.ingenuitynow.net/This+Is+A+Post.aspx

WordPress: www.schwammysays.net/this-is-a-post/

There are 3 differences, aside from the obvious fact that I changed domain names:

  • Uppercase vs. lowercase
  • Plus instead of dashes between words
  • .aspx extension vs. “/”

To set up all the redirection:

  • Set up the Domain: Next I used the tools where my domain schwammysays.net is registered and added an CNAME record to point to my new Azure site. FYI, my plan was to get it all working before redirecting the old domain (blog.ingenuitynow.net) to the new one.
  • Redirection: I’ve heard great things about the Redirection plugin so I configured it to route my old post name to my new post name. (I had a list of all the posts with old and new names courtesy of the dasblogML export tool).
  • Unfortunately, the redirection wasn’t working. I tried a bunch of different stuff but after a while I figured out that the plus sign in the URL was causing trouble. My thought was that WordPress was having an issue with the special character. Spoiler alert, I later realized that wasn’t exactly right. i thought I was stuck at this point until Nick reminded me of something that should have been obvious to me all along. I may be running WordPress on Azure but it is really just a website running on IIS. The assumption was that I’d need to deal with the plus sign before WordPress got involved. It is pretty easy to write custom HTTP Handlers with C# and plug them into the site. Nick was even so kind that he sent me a great code snippet to change the URL and issue a 301 redirection error too.
  • However, the handler wasn’t working! It wasn’t getting hit at all. I figured out that some of the web.config settings for WordPress were getting in the way. The WordPress site had some redirects built into the config file and they were getting called before my handler. I changed the web.config file as seen here. I added the parts highlighted in yellow:
        <rewrite>
          <rules>

    <rule name=”old” patternSyntax=”Wildcard” stopProcessing=”true”> <match url=”*.aspx”/> <action type=”None” /> </rule>

            <rule name="wordpress" patternSyntax="Wildcard">
                        <match url="*"/>
                            <conditions>
                                <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true"/>
                                <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true"/>
                            </conditions>
                        <action type="Rewrite" url="index.php"/>
                    </rule>
          </rules>
        </rewrite>

    With the handler in place, I tested it and guess what… it still didn’t work. I did some more research and found out that by default, asp.net sites don’t allow plus signs in the URL. I’m no expert on this topic but it is called double escaping. A quick change to the web.config file and everything was working.

    <system.webServer>
        <security>
          <requestFiltering allowDoubleEscaping="true"/>
        </security>

    While I did not test this, my guess is that, had I updated my web.config file earlier to allow double escaping, the WordPress redirection plugin would probably have worked for me and the http handler would not have been needed. But actually, the handler is easier since it does all of my URLs in one shot.

     

  • Lastly, I sent back to my domain tools and sent traffic for blog.ingenuitynow.net to the Azure site.

This was a fairly long process. Some of it was easy. Some of it would have been easier if I knew more about URL redirection and DNS. But since you are reading this post, it seems that everything has finally worked out!

Leave a reply

required

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>