Restore a deleted Azure Database for MySQL
When an Azure Database for MySQL Flexible Server instance is deleted, the server backup can be retained for up to five days in the service. The server backup can be accessed and restored only from the Azure subscription where the server initially resided. The following recommended steps can be followed to recover a deleted Azure Database for MySQL Flexible Server resource within five days from the time of server deletion. The recommended steps work only if the backup for the server is still available and not deleted from the system.
Prerequisites
To restore a deleted Azure Database for MySQL Flexible Server instance, you need the following:
- Azure Subscription name hosting the original server
- Location where the server was created
Restore steps
Go to the Activity Log from the Monitor page in Azure portal.
In the Activity Log, select Add filter as shown and set the following filters for the:
- Subscription = Your Subscription hosting the deleted server
- Resource Type = Azure Database for MySQL Flexible Server (Microsoft.DBforMySQL/flexibleServers)
- Operation = Delete MySQL Server (Microsoft.DBforMySQL/flexibleServers/delete)
Select the Delete MySQL Server event, select the JSON tab, and note the "resourceId" and "submissionTimestamp" attributes in JSON output. The resourceId is in the following format:
/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TargetResourceGroup/providers/Microsoft.DBforMySQL/flexibleServers/deletedserver
.The following is Request Body section:
{ "location": "Dropped Server Location", "properties": { "restorePointInTime": "submissionTimestamp - 15 minutes", "createMode": "PointInTimeRestore", "sourceServerResourceId": "resourceId" } }
Replace the following values in the request body above:
- Dropped server Location with the Azure region where the deleted server was created
submissionTimestamp
andresourceId
with the values captured in Step 3.- For
restorePointInTime
, specify a value ofsubmissionTimestamp
minus 15 minutes to ensure the command doesn't error out.
If you see Response Code 201 or 202, the restore request is successfully submitted.
The server creation can take time, depending on the database size and computing resources provided on the original server. The restore status can be monitored from:
- Activity log by filtering for:
- Subscription = Your Subscription
- Resource Type = Azure Database for MySQL Flexible Server (Microsoft.DBforMySQL/flexibleServers)
- Operation = Update MySQL Server Create
- Activity log by filtering for:
Azure Resource Manager environment URLs
- For Microsoft Azure operated by 21Vianet, the URL is
https://management.chinacloudapi.cn
.