Azure Mysql – Easiest way to Migrate workloads for onpremise or Azure web apps

Customers on Azure who have deployed multiple open source solution had a common problem – Most of the open solutions, stacks use MySQL as an RDBMS. For a long time, clearDB was the only MySQL provider on Azure Cloud.

This cost problem as commercial plans of ClearDB and service SLA’s was not to the satisfaction of many customers.

Azure MySQL was a welcome effort from engineering team as the customers are waiting for it for long.

Normally MySQL Databases are of ILDSM or INNODB. The simplest way to migrate such application is using MySQL workspace.

Problem and Steps

1.Plan for the downtime of your web app

2. Capture the MySQL connection string and take MySQL dump using MySQL workspace

shell> mysqldump –all-databases > dump.sql
                          shell> mysqldump –databases db1 db2 db3 > dump.sql

3. Check for MySQL users and their permissions.

4. Connect to the new MySQL database at Azure MySQL.

5. Import the dump take earlier.

mysql> source dump.sql
                        or mysql> CREATE DATABASE IF NOT EXISTS db1;
                        mysql> USE db1;
                        mysql> source dump.sql

6. Assign user permissions if required

7. Modify the connection string in the configuration file in the web app