Migrate a WordPress blog site hosted on Microsoft Azure

It has been a bit more than a year since I put together the Novotips blog site using a dedicated server hosted in the Microsoft Azure cloud service. This article describes my recent positive experience migrating this blog to an updated platform. The process that I’m going to outline below took roughly an hour to complete and only interrupted the availability of the blog site for a few minutes.

Procedure Overview

Step 1: Build a new WordPress platform in Microsoft Azure

Step 2: Perform a backup of the existing blog site

Step 3: Restore the blog site on the new platform

Step 4: Perform testing of the new blog site to ensure that everything works OK

Step 5: Cutover from the old blog site to the new blog site

Procedure Details

Step 1: Build a new WordPress platform in Microsoft Azure

This step was performed from within the Microsoft Azure portal (https://portal.azure.com).

I didn’t want to invest the time that would be needed to download, install and configure everything by myself from scratch, so I decided to utilise something that was already pre-built. Microsoft Azure provides two easy methods of hosting a pre-built WordPress blog from the Azure Marketplace:

  • Web App – This option provides a fully managed hosted platform that is optimised for hosting websites and web applications such as WordPress. In the Azure Marketplace this choice has a category of “Web + Mobile”.
  • Virtual Machine Image – This option provides a pre-configured image that you can deploy on a server (virtual machine) of your choice. In the Azure Marketplace this choice has a category of “Compute”.

The following figure shows the choices that were available to me from the Azure Marketplace at the time of writing this article.

I chose to host the blog site using a virtual server image (Compute category). After selecting the image that I wanted to use, I was presented with a fairly simple wizard to provision the server. The following screenshots and explanations describe the choices that I made. These are not necessarily best practices, but suffice to show the complexity and functionality that is available.

After completing the final screen in the wizard, the provisioning of the new virtual machine took a few minutes to finish. At this point the new blog site was ready to login to.

Step 2: Perform a backup of the existing blog site

This step was performed from the existing Novotips blog site.

I backed up the blog site using the “All-in-One WP Migration” plugin. With this plugin it is very easy to backup and restore your entire blog site. I also use the plugin during operations to make an offline backup of my entire blog site as a single file.

Note:

If this plugin is not already installed in your existing blog site then you should install it at this point. You should also update all the other plugins, as well as WordPress if it is needed, to the latest versions.

As shown in the following figure, I created a backup of the existing blog site by selecting the “Export Site To File” option within the plugin. Once the backup had been created, I clicked on the download box within the plugin to download the backup (a single file) to my computer.

TIP: This plugin provides a good way to create an offline backup of your blog site.

Step 3: Restore the blog site on the new platform

This step was performed from the new Novotips blog site.

Once the provisioning of the virtual machine completed, I was able to login to the new blog site using the Public IP address associated with the new virtual machine (e.g. http://52.166.56.131 ).  I found the public IP address within the Azure portal by looking at the “Overview” screen associated with the new virtual machine. This is shown in the following image:

Note:

The credentials that I specified in the virtual machine provisioning wizard were for logging into the server operating system, not for logging into the WordPress blog site. You may need to read through some documentation in the support link associated with your virtual machine image to determine the credentials that you need to login to the new blog site.

After logging in to the new blog site from a web browser, the first thing that I did was update all the plugins. I also upgraded WordPress because there was a new version available. After performing these updates I saw something like the following in the “WordPress Updates” screen:

Note:

If the “All-in-One WP Migration” plugin isn’t already installed on your new server, you should now install it. In the virtual machine image that I chose, this plugin was already installed so there was no need for me to do this.

As shown in the following figure, I restored the blog site by selecting the “Import Site From File” option within the plugin. After this I had to specify where the backup file was located on my computer.

Once the restore was complete I was asked to save changes a couple of times. I then switched back to the Azure portal and restarted the new virtual machine.

The new blog site should now be identical to the existing blog site, albeit with new versions of underlying components.

Step 4: Perform testing of the new blog site to ensure that everything works OK

This step was performed from the new Novotips blog site.

During this step, I simply logged into the new blog site (with the same credentials as used in the existing blog site) and looked at a couple of blogs and various admin settings to ensure that things were working properly. I didn’t need to do make any changes; the “All-in-One WP Migration” plugin had done everything for me including things like installing the custom plugins that I use.

Step 5: Cutover from the old blog site to the new blog site

This step was performed from within the Microsoft Azure portal (https://portal.azure.com).

To direct traffic to my existing blog site (e.g. http://blog.novotips.com), I had a DNS CNAME record pointing to the optional “DNS name label” that was associated with the existing virtual server. For example, the “blog.novotips.com” CNAME record pointed to “vm-wordpress.westeurope.cloudapp.azure.com”.

I had two options regarding how to implement the cutover.

  • Option 1: Create a new “DNS name label”  for the new virtual machine (e.g. vm-wordpress-new.westeurope.cloudapp.azure.com) then change the public DNS CNAME record (e.g. blog.novotips.com) to point to the new DNS name label.
  • Option 2: Change the “DNS name label” associated with the existing server to anything you like. Afterwards, change the “DNS name label” associated with the new server to whatever name the existing CNAME record pointed to (e.g. vm-wordpress.westeurope.cloudapp.azure.com).

Both options had the same advantages/disadvantages. The main difference is whether I wanted to make the change in the Azure portal or in the administration portal of my public DNS provider. I chose Option 2 simply because I was already logged into the Azure portal.

To make the change I clicked on the ” Public IP address/DNS name label” link within the “Overview” screen of the existing server. This took me to the configuration screen for the public IP address associated with this server. The following figure, shows the existing DNS name label after it was changed to an arbitrary value. After saving this change, I used a similar process to change the DNS name label associated with the new server to be the same as the original value of the existing server (e.g. vm-wordpress.westeurope.cloudapp.azure.com)

Conclusion

I hope this article showed that migrating a WordPress blog site that is hosted on Microsoft Azure can be a fairly simple process.

Leave a Comment

Your email address will not be published.

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