다음을 통해 공유


Restore a deleted Azure Database for MariaDB server

Important

Azure Database for MariaDB is on the retirement path. We strongly recommend that you migrate to Azure Database for MySQL. For more information about migrating to Azure Database for MySQL, see What's happening to Azure Database for MariaDB?.

When a server is deleted, the database server backup can be retained up to five days in the service. The database backup can be accessed and restored only from the Azure subscription where the server originally resided. The following recommended steps can be followed to recover a deleted MariaDB server resource within 5 days from the time of server deletion. The recommended steps will work only if the backup for the server is still available and not deleted from the system.

Pre-requisites

To restore a deleted Azure Database for MariaDB server, you need following:

  • Azure Subscription name hosting the original server
  • Location where the server was created

Steps to restore

  1. Go to the Activity Log from Monitor blade in Azure portal.

  2. In Activity Log, select on Add filter as shown and set following filters for the

    • Subscription = Your Subscription hosting the deleted server
    • Resource Type = Azure Database for MariaDB servers (Microsoft.DBForMariaDB/servers)
    • Operation = Delete MariaDB Server (Microsoft.DBForMariaDB/servers/delete)

    Activity log filtered for delete MariaDB server operation

  3. Double Select on the Delete MariaDB Server event and select on 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.DBForMariaDB/servers/deletedserver.

  4. Go to Create Server REST API Page and select on "Try It" tab highlighted in green and login in with your Azure account.

  5. Provide the resourceGroupName, serverName (deleted server name), subscriptionId, derived from resourceId attribute captured in Step 3, while api-version is pre-populated as shown in image.

    Create server using REST API

  6. Scroll below on Request Body section and paste the following:

    {
        "location": "Dropped Server Location",  
        "properties": 
            {
                "restorePointInTime": "submissionTimestamp - 15 minutes",
                "createMode": "PointInTimeRestore",
                "sourceServerId": "resourceId"
            }
    }
    
  7. Replace the following values in the above request body:

    • "Dropped server Location" with the Azure region where the deleted server was originally created
    • "submissionTimestamp", and "resourceId" with the values captured in Step 3.
    • For "restorePointInTime", specify a value of "submissionTimestamp" minus 15 minutes to ensure the command does not error out.
  8. If you see Response Code 201 or 202, the restore request is successfully submitted.

  9. The server creation can take time depending on the database size and compute resources provisioned on the original server. The restore status can be monitored from Activity log by filtering for

    • Subscription = Your Subscription
    • Resource Type = Azure Database for MariaDB servers (Microsoft.DBForMariaDB/servers)
    • Operation = Update MariaDB Server Create

Next steps

  • If you are trying to restore a server within five days, and still receive an error after accurately following the steps discussed earlier, open a support incident for assistance. If you are trying to restore a deleted server after five days, an error is expected since the backup file cannot be found. Do not open a support ticket in this scenario. The support team cannot provide any assistance if the backup is deleted from the system.
  • To prevent accidental deletion of servers, we highly recommend using Resource Locks.