Moving from Azure WordPress Website to Azure VM

After moving my SharePoint blog site to an Azure WordPress website, I realized that the MySQL database was also in the cloud with ClearDB and was limited to 20MB which doesn’t really give me much space to grow. I thought a good idea would be to just create my Azure VM with a WordPress install and MySQL instance on it and then migrate the site again.

Since my site was now in WordPress, I figured the migration would be easier.  I was able to find a nifty plug-in called “UpdraftPlus Backup/Restore“.  This enables you to just install the plug-in on both the source and target WordPress installs and then just restore everything (Including plug-ins and themes). With a plan in mind I decided to go for broke.

So the journey began and I did the following:

  1. Created an Azure VM (using the Server 2012 R2 template).
    • Added Application Server Role with IIS
    • Installed Web Platform Installer then added MySQL and WordPress
    • Put and entries to in the hosts file
    • Launched WordPress with the default install using my same URL as a host header
    • Installed UpdraftPlus Backup/Restore plug-in
  2. Backed up my original WordPress site running on Azure
    • Installed UpdraftPlus Backup/Restore plug-in
    • Ran a backup and downloaded all files (Database, Plugins, Themes, Uploads, Others)
    • Copied .zip and .gz backup files to the new Azure VM
  3. Restored back-up files on new Azure VM instance
    • Uploaded backup files within the UpdraftPlus plug-in by dragging and dropping them in.
    • Performed a ‘Restore’
    • Logged back-in with user credentials from the original WordPress site.
  4. Verified site functions locally
  5. Updated DNS with my ISP to point to the public IP address for my Azure VM

I realized that the cost of running the Azure Website was $.01/hr more than the cost of running the Azure VM (for a comparable size).  I know this new setup is going to be more of a maintenance overhead for me, but it will give me an excuse to keep up to date with everything and also be able to RDP into the server.

New Year -> New Blog -> From Office 365 to an Azure WordPress site

If the new year is meant to bring renewal in all things, then my blog will be first (or possibly third, considering I didn’t get to it until the 3rd of the month) on the list of renewed life and expectations.

I had been playing around with different aspects of Azure websites and ran across the Azure WordPress template.  Although I spun it up over a year ago, life (2nd child, moving residences and work responsibility) intervened and I was unable to get my blog kicked off as I had hoped. Enter 2015!

Although I have not been a prolific blogger by any stretch of the imagination, I had some posts within my SharePoint Office 365 website and didn’t want to just start over.  I came across a recent blog post by René Hézser where he posts about migrating a SharePoint blog to WordPress and provides an entire windows application and source code.  I had to try out the code and see if it could give me the shortcut I was hoping to find.

What I discovered was that his code uses the lists.asmx web service on the SharePoint side and was designed to use credentials for an on-premises SharePoint blog.  With a little bit of fiddling with the code using techniques found on Tomasz Rabiński’s blog, I was able to just swap out the authentication credentials and leave the rest of the code intact.

Steps Taken:

  1. Add reference to Microsoft.SharePoint.Client.RunTime
  2. Modify the Connect() method to use SharePoint online credentials

After this, I was able to just do the migration with the authentication working like a charm.  A nice beginning to a new year!