Azure

Migrating WordPress to Azure App

I recently migrated my WordPress blog over to Azure as I was getting frustrated with the lack of control and there was a issue with PHP versioning that my hosting provider couldn’t seem to resolve.  The process was ridiculously easy so I thought I would document the steps here if somebody is thinking about doing a similar thing.

Step 1 – Create Web App in Azure

The first stage in the process was to create a Web App in the Azure Portal. So head over there and find the “WordPress on Linux” app

image

Once that has been created you will need to populate it wit the Required fields. You will need to enter:

  • App name – This will be the name of your site so choose something relevant and that is available. i.e. if you call your website Testing123 the URL will be Testing123.azurewebsites.net
  • Your Subscription type – Select your subscription you want this App to be associated with
  • Resource Group – We can either create a new Resource Group to be associated (recommend) or put the App and its associated records into an existing resource group
  • In the Database section enter the required details i.e. database name and admin logon name

We will also need to select a pricing tier. Since my blog doesn’t get that many hits (sniff sniff) I used Basic which should be enough, although you can upgrade at a later time.  This only will cost me around £13.50 per month, the Standard tier was around £60 per month

image

Once the app has been created you should see the Resource Group and the associated records in the Portal

image

Step 2 – Configure WordPress Database

Now that the App has been deployed we can configure WordPress.  If you go to the URL appname.azurewebsites.net you should get the standard WordPress installation page.  You will be asked for your database credentials which you configured in the Azure portal.  If you cannot remember them you can retrieve them from the App as per below

image

Enter the details as requested

image

Once you have done that press the submit button and your site will be configured.

Step 3 – Export WordPress content from old site and import into the new site

This was the step I was worried about, but turned out to be the easiest bit!! Log into old WordPress site, go to the Tools menu and select Export, select All Content and this will export an XML file.  Go to your new site and then run the import.  This will then import all your WordPress hosts.  Be warned though, it does not copy over the images so we have to do this manually

image

Step 4 – Export and Import Images

Log into your old site via FTP and connect to the directory /wwwroot/wp-content/uploads and copy everything onto your computer.

image

Connect to your Azure site via FTP.  First you will need to create an FTP user account under the Deployment credentials tab. Once you have this you can find the rest of the details in the Azure Portal under the Overview tab for the App.  Once you have connected and uploaded the files you previously downloaded your site should be fully functioning but using the azurewebsites.net URL

image

Step  5- Redirect URL

I wanted to have a Custom URL for my website so if you go into the Custom domains tab you can configure a custom domain.  If you don’t own the domain and it is available you can buy it here and the configuration will happen automatically.

If you want to migrate an existing domain you will need to update your A record and TXT record to point to your new Azure hosted Site.

image

After this everything is done!!

I have a few over things I still need to do like configure SSL and setup CDN and Load Balancing but I will do that when I get some more spare time.  Enjoy!

Leave a Reply

Your email address will not be published. Required fields are marked *