Migrating from ClearDB to Azure MySQL

ClearDB is no longer included as part of my MSDN subscription.  I could either pay extra or migrate to the new Azure database for MySQL server.  I chose to migrate.  The process wasn’t that hard.  Basically, you go into the portal and create a new MySQL server.

https://docs.microsoft.com/en-us/azure/mysql/quickstart-create-mysql-server-database-using-azure-portal

Once I got the database server in place, I uploaded a copy of my old database with data using MySQL Workbench.  I validated everything before moving forward.  At this point, I was still pointing WordPress to the ClearDB MySQL host.

https://www.mysql.com/products/workbench/

Next, I added a new user.

https://docs.microsoft.com/en-us/azure/mysql/howto-create-users

Next, I updated the wp_config.php file.

Here are the changes I needed to make.  I used KUDU under the ‘Advanced Tools’ in the App Server to edit the file in place as opposed to downloading/uploading it through an FTP client.

Using KUDU with Microsoft Azure Web Apps

// ** MySQL settings - You can get this info from your web host ** //
/** The name of the database for WordPress */
define('DB_NAME', '<wordpress database name>');

/** MySQL database username */
define('DB_USER', '<username>@<database server name>');
 
/** MySQL database password */
define('DB_PASSWORD','<username password>');

/** MySQL hostname */
define('DB_HOST', ',<database server name>.mysql.database.azure.com');

 

The gotcha for me was the database name.  I was thinking the config wanted the database server name when it was asking for the database container name.  On ClearDB, I used the same name for both so I mislead myself by poorly naming things when I set everything up.

Oops.

Once I got that sorted, everything worked fine.

Enjoy.

 

Leave a Reply

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