From previous post, I managed to set up WordPress on Azure, so now is time to move on. To move my existing WordPress over, very obviously I need to do backup, transfer, and setup.

Backup Database

PhpMyAdmin export database
PhpMyAdmin export database

  1. Log in to existing hosting’s PhpMyAdmin.
  2. Go to Export tab and then click Go button, and it will download the backup script file.

Since I’m going to reuse the same domain on my new server not changing new domain, so I did not edit the backup SQL script to update it with new domain.

Backup WordPress Files

WordPress wp-content folder
WordPress wp-content folder

I didn’t edit much files on my WordPress, so I’m going to backup just wp-content folder.

Restoring Database

Azure - Manage database
Azure – Manage database

  1. From Azure portal, go to the MySQL database created.
  2. Click the Manage Database icon, and it will open up a link to https://www.cleardb.com, that is the service Azure use for MySQL.
    ClearDB - Database Details
    ClearDB – Database Details
  3. Go to the Endpoint Information tab, and get the login information there.
  4. Log in with MySQL client.
    MySQL drop tables
    MySQL drop tables
  5. Drop all the tables.
  6. Run the script backed up from the existing WordPress.

Restoring WordPress Contents

  1. Log in to Azure portal, and go to the App Service.
    Azure - Set deployment details
    Azure – Set deployment details
  2. From the settings, click Deployment credentials and then create a FTP user.
  3. After that login using FTP client with the newly created user, the username will be App Name/username.
    wwwroot
    wwwroot
  4. Replace the wp-content folder with the one from existing WordPress.

Creating CNAME at Domain Provider

Before I can use my domain in Azure, I’ll need to create CNAME at GoDaddy.

GoDaddy - domain details
GoDaddy – domain details

Apparently I’m using HostGator’s name server, so I’m not allow to change.

GoDaddy - nameserver settings
GoDaddy – nameserver settings

So I decided to just change my Nameserver back to Standard.

GoDaddy - DNS zone files
GoDaddy – DNS zone files

After I changed that, I’m allow to add or edit records. However I can’t map www.stephensaw.me to azurewebsite.net as I already has a host WWW points to @.

GoDaddy - CName
GoDaddy – CName

I’ll need to edit that one instead.

GoDaddy - Edit CName
GoDaddy – Edit CName

The Host and the Points To will be given by Azure Portal when we trying to add external domain to the App Service.

Azure web 404
Azure web 404

After it propagated, I’ll see the “blue screen of death” when I visit www.stephensaw.me, as it no longer pointing to my HostGator. Man, they really love blue screen.

Using Existing Domain Name on Azure

After everything, now I’ll have to point the www.stephensaw.me domain to the Azure.

Azure - Custom domains and SSL
Azure – Custom domains and SSL

(Yeah, I can’t afford the plan that support SSL)

  1. Go to the App Service’s setting, and go to Custom domains and SSL.
  2. Click the Bring External Domains.
  3. Following the instruction, I already created the CNAME at GoDaddy above.
  4. Key in existing domain and save, and wait for it to update, it takes time.