Major version upgrade in Azure Database for MySQL single server
APPLIES TO: Azure Database for MySQL - Single Server
Tábhachtach
Azure Database for MySQL single server is on the retirement path. We strongly recommend that you upgrade to Azure Database for MySQL flexible server. For more information about migrating to Azure Database for MySQL flexible server, see What's happening to Azure Database for MySQL Single Server?
Nóta
This article contains references to the term slave, a term that Microsoft no longer uses. When the term is removed from the software, we will remove it from this article.
Tábhachtach
Major version upgrade for Azure database for MySQL single server is in public preview.
This article describes how you can upgrade your MySQL major version in-place in Azure Database for MySQL single server.
This feature will enable customers to perform in-place upgrades of their MySQL 5.6 servers to MySQL 5.7 with a click of button without any data movement or the need of any application connection string changes.
Nóta
- Major version upgrade is only available for major version upgrade from MySQL 5.6 to MySQL 5.7.
- The server will be unavailable throughout the upgrade operation. It is therefore recommended to perform upgrades during your planned maintenance window. You can consider performing minimal downtime major version upgrade from MySQL 5.6 to MySQL 5.7 using read replica.
Follow these steps to perform major version upgrade for your Azure Database of MySQL 5.6 server using Azure portal
Tábhachtach
We recommend to perform upgrade first on restored copy of the server rather than upgrading production directly. See how to perform point-in-time restore.
In the Azure portal, select your existing Azure Database for MySQL 5.6 server.
From the Overview page, click the Upgrade button in the toolbar.
In the Upgrade section, select OK to upgrade Azure database for MySQL 5.6 server to 5.7 server.
A notification will confirm that upgrade is successful.
Follow these steps to perform major version upgrade for your Azure Database of MySQL 5.6 server using Azure CLI
Tábhachtach
We recommend to perform upgrade first on restored copy of the server rather than upgrading production directly. See how to perform point-in-time restore.
Install Azure CLI for Windows or use Azure CLI in Azure Cloud Shell to run the upgrade commands.
This upgrade requires version 2.16.0 or later of the Azure CLI. If using Azure Cloud Shell, the latest version is already installed. Run az version to find the version and dependent libraries that are installed. To upgrade to the latest version, run az upgrade.
After you sign in, run the az mysql server upgrade command:
az mysql server upgrade --name testsvr --resource-group testgroup --subscription MySubscription --target-server-version 5.7"
The command prompt shows the "-Running" message. After this message is no longer displayed, the version upgrade is complete.
In the Azure portal, select your existing Azure Database for MySQL 5.6 read replica server.
From the Overview page, click the Upgrade button in the toolbar.
In the Upgrade section, select OK to upgrade Azure database for MySQL 5.6 read replica server to 5.7 server.
A notification will confirm that upgrade is successful.
From the Overview page, confirm that your Azure database for MySQL read replica server version is 5.7.
Now go to your primary server and Perform major version upgrade on it.
You can perform minimal downtime major version upgrade from MySQL 5.6 to MySQL 5.7 by utilizing read replicas. The idea is to upgrade the read replica of your server to 5.7 first and later failover your application to point to read replica and make it a new primary.
In the Azure portal, select your existing Azure Database for MySQL 5.6.
Create a read replica from your primary server.
Upgrade your read replica to version 5.7.
Once you confirm that the replica server is running on version 5.7, stop your application from connecting to your primary server.
Check replication status, and make sure replica is all caught up with primary so all the data is in sync and ensure there are no new operations performed in primary.
Call the
show slave status
command on the replica server to view the replication status.SHOW SLAVE STATUS\G
If the state of
Slave_IO_Running
andSlave_SQL_Running
are "yes" and the value ofSeconds_Behind_Master
is "0", replication is working well.Seconds_Behind_Master
indicates how late the replica is. If the value isn't "0", it means that the replica is processing updates. Once you confirmSeconds_Behind_Master
is "0" it's safe to stop replication.Promote your read replica to primary by stopping replication.
Point your application to the new primary (former replica) which is running server 5.7. Each server has a unique connection string. Update your application to point to the (former) replica instead of the source.
Nóta
This scenario will have downtime during steps 4, 5 and 6 only.
When will this upgrade feature be GA as we have MySQL v5.6 in our production environment that we need to upgrade?
The GA of this feature is planned before MySQL v5.6 retirement. However, the feature is production ready and fully supported by Azure so you should run it with confidence on your environment. As a recommended best practice, we strongly suggest you to run and test it first on a restored copy of the server so you can estimate the downtime during upgrade, and perform application compatibility test before you run it on production. For more information, see how to perform point-in-time restore to create a point in time copy of your server.
Yes, the server will be unavailable during the upgrade process so we recommend you perform this operation during your planned maintenance window. The estimated downtime depends on the database size, storage size provisioned (IOPs provisioned), and the number of tables on the database. The upgrade time is directly proportional to the number of tables on the server.The upgrades of Basic SKU servers are expected to take longer time as it is on standard storage platform. To estimate the downtime for your server environment, we recommend to first perform upgrade on restored copy of the server. Consider performing minimal downtime major version upgrade from MySQL 5.6 to MySQL 5.7 using read replica.
You can still continue running your MySQL v5.6 server as before. Azure will never perform force upgrade on your server. However, the restrictions documented in Azure Database for MySQL versioning policy will apply.
Learn about Azure Database for MySQL versioning policy.