|
| 1 | +--- |
| 2 | +title: Back up the Azure Database for MySQL - Flexible Server by using Azure Backup |
| 3 | +description: Learn how to back up the Azure Database for MySQL - Flexible Server. |
| 4 | +ms.topic: how-to |
| 5 | +ms.date: 02/16/2024 |
| 6 | +author: AbhishekMallick-MS |
| 7 | +ms.author: v-abhmallick |
| 8 | +--- |
| 9 | + |
| 10 | +# Back up the Azure Database for MySQL - Flexible Server by using Azure Backup (preview) |
| 11 | + |
| 12 | +This article describes how to back up the Azure Database for MySQL - Flexible Server by using Azure Backup. |
| 13 | + |
| 14 | +>[!Important] |
| 15 | +>- Currently, this feature supports only the *Weekly backup* option. However, you can schedule the backups on multiple days of the week. |
| 16 | +>- Retention duration ranges from *7 days* to *10 years* in the *Backup data store*. |
| 17 | +>- Each retention rule requires inputs for specific backups, data store, and retention duration for the backups. |
| 18 | +>- The retention rules are evaluated in a pre-determined order of priority. The priority is the highest for the yearly rule, followed by the monthly, and then the weekly rule. Default retention settings are applied when no other rules qualify. For example, the same recovery point may be the first successful backup taken every week as well as the first successful backup taken every month. However, as the monthly rule priority is higher than that of the weekly rule, the retention corresponding to the first successful backup taken every month applies. |
| 19 | +>- By default, the retention rule is set to *3 months* if no retention rule is set. |
| 20 | + |
| 21 | + |
| 22 | +Learn more about the [supported scenarios. considerations, and limitations](backup-azure-mysql-flexible-server-support-matrix.md). |
| 23 | + |
| 24 | +## Create a backup policy for the Azure MySQL - Flexible Server database backup |
| 25 | + |
| 26 | +To create a backup policy, follow these steps: |
| 27 | + |
| 28 | +1. [Create a Backup vault](create-manage-backup-vault.md#create-a-backup-vault). |
| 29 | + |
| 30 | +2. Go to the *Backup vault* > **+Backup** to open the **Configure backup** page. |
| 31 | +3. To create a new backup policy, under **Backup policy**, select **Create new**. |
| 32 | + |
| 33 | + |
| 34 | + :::image type="content" source="./media/backup-azure-mysql-flexible-server/create-backup-policy.png" alt-text="Screenshot shows how to start creating the new backup policy." lightbox="./media/backup-azure-mysql-flexible-server/create-backup-policy.png"::: |
| 35 | + |
| 36 | +4. On the **Create Backup Policy** page, enter a name for the new policy, and then select **Azure Database for MySQL (Preview)** as the **Datasource type**. |
| 37 | + |
| 38 | +5. On the **Schedule + retention** tab, define the **Backup schedule**. |
| 39 | + |
| 40 | + :::image type="content" source="./media/backup-azure-mysql-flexible-server/schedule-retention-final.png" alt-text="Screenshot shows the process to configure the backup schedule." lightbox="./media/backup-azure-mysql-flexible-server/schedule-retention-final.png"::: |
| 41 | + |
| 42 | + |
| 43 | + |
| 44 | + Define the **Retention** settings. |
| 45 | + |
| 46 | + :::image type="content" source="./media/backup-azure-mysql-flexible-server/add-retention.png" alt-text="Screenshot shows how to configure the retention duration." lightbox="./media/backup-azure-mysql-flexible-server/add-retention.png"::: |
| 47 | + |
| 48 | + You can add one or more retention rules. To add more retention rules, select **Add**. |
| 49 | + |
| 50 | +6. You can move the backups from *backup data store* to *archive data store* once they expire as per the backup policy. |
| 51 | + |
| 52 | + To archive backups on expiry, select **On-expiry**. |
| 53 | + |
| 54 | + >[!Note] |
| 55 | + >- Retention duration ranges from *7 days* to *10 years* in the *Backup data store*. |
| 56 | + >- As per the pre-determined order of priority, the retention with the *yearly* rule selected has the highest priority, followed by the monthly, and then the weekly rule. By default, the retention rule is set to *3 months* if no retention rule is set. |
| 57 | +
|
| 58 | +7. Select **Review + create**. |
| 59 | + |
| 60 | +## Configure backup on Azure Database for MySQL - Flexible Server |
| 61 | + |
| 62 | +You can configure backup for the entire Azure databases for MySQL - Flexible Server. |
| 63 | + |
| 64 | +To configure backup, follow these steps: |
| 65 | + |
| 66 | +1. On the **Azure portal**, go to *Backup vault* > **+Backup**. |
| 67 | + |
| 68 | + :::image type="content" source="./media/backup-azure-mysql-flexible-server/configure-backup.png" alt-text="Screenshot shows how to start the backup configuration." lightbox="./media/backup-azure-mysql-flexible-server/configure-backup.png"::: |
| 69 | + |
| 70 | + :::image type="content" source="./media/backup-azure-mysql-flexible-server/configure-backup-basic.png" alt-text="Screenshot shows the Basic tab on the configuration page." lightbox="./media/backup-azure-mysql-flexible-server/configure-backup-basic.png"::: |
| 71 | + |
| 72 | + Alternatively, go to **Backup center** > **+Backup**. |
| 73 | + |
| 74 | +2. Select the backup policy you created, which defines the backup schedule and the retention duration. |
| 75 | + |
| 76 | + :::image type="content" source="./media/backup-azure-mysql-flexible-server/configure-backup-policy.png" alt-text="Screenshot shows the selection of the backup policy." lightbox="./media/backup-azure-mysql-flexible-server/configure-backup-policy.png"::: |
| 77 | + |
| 78 | +3. Select the **Azure Database for MySQL - Flexible Server** to back up. |
| 79 | + |
| 80 | + You can choose an Azure Database for MySQL - Flexible Servers across subscriptions if they're in the same region as that of the vault. |
| 81 | + |
| 82 | + :::image type="content" source="./media/backup-azure-mysql-flexible-server/datasources-select-resources.png" alt-text="Screenshot shows the selection of the database server for backup." lightbox="./media/backup-azure-mysql-flexible-server/datasources-select-resources.png"::: |
| 83 | + |
| 84 | +4. Select **Add** and choose the Azure Database for MySQL - Flexible Server that you want to back up. |
| 85 | + |
| 86 | + :::image type="content" source="./media/backup-azure-mysql-flexible-server/datasources.png" alt-text="Screenshot shows the selection of the datasource type." lightbox="./media/backup-azure-mysql-flexible-server/datasources.png"::: |
| 87 | + |
| 88 | + After the selection, the backup readiness check validates to ensure the configuration is correct. |
| 89 | + |
| 90 | + :::image type="content" source="./media/backup-azure-mysql-flexible-server/datasources-readiness-check.png" alt-text="Screenshot shows the validation is successful." lightbox="./media/backup-azure-mysql-flexible-server/datasources-readiness-check.png"::: |
| 91 | + |
| 92 | +5. To resolve any access issues, select **Assign missing roles**. |
| 93 | + |
| 94 | + |
| 95 | +6. Review the configuration details, and then select **Configure Backup**. |
| 96 | + |
| 97 | + :::image type="content" source="./media/backup-azure-mysql-flexible-server/create-backup-policy-final.png" alt-text="Screenshot shows how to finish the backup configuration." lightbox="./media/backup-azure-mysql-flexible-server/create-backup-policy-final.png"::: |
| 98 | + |
| 99 | + To track the progress, go to **Backup Instances**. |
| 100 | + |
| 101 | +## Run an on-demand backup |
| 102 | + |
| 103 | +To trigger an on-demand backup (that's not in the schedule specified in the policy), follow these steps: |
| 104 | + |
| 105 | +1. Go to the *Backup vault* > **Backup Instances**, and then select the *backup instance* for which you want to take backup. |
| 106 | + |
| 107 | +2. Select **Backup Now**. |
| 108 | + |
| 109 | + :::image type="content" source="./media/backup-azure-mysql-flexible-server/backup-instances.png" alt-text="Screenshot shows how to run an on-demand backup." lightbox="./media/backup-azure-mysql-flexible-server/backup-instances.png"::: |
| 110 | + |
| 111 | +3. On the *MySQL database instance* page, choose a retention rule from the list. |
| 112 | +4. Select **Backup now**. |
| 113 | + |
| 114 | +## Monitor a backup job |
| 115 | + |
| 116 | +Azure Backup creates a job for scheduled backups or if you trigger on-demand backup operation for tracking. To view the backup job status, go to **Backup jobs**. |
| 117 | + |
| 118 | +:::image type="content" source="./media/backup-azure-mysql-flexible-server/track-backup-jobs.png" alt-text="Screenshot shows the list of backup jobs." lightbox="./media/backup-azure-mysql-flexible-server/track-backup-jobs.png"::: |
| 119 | + |
| 120 | +It shows the **Backup jobs** dashboard with the operations and status for the *past seven days*. You can select the time range and other filters to narrow down your selection. |
| 121 | + |
| 122 | +To view the status of all backup jobs, select **All** as the **Status**. The ongoing and past jobs of the backup instance appear. |
| 123 | + |
| 124 | +:::image type="content" source="./media/backup-azure-mysql-flexible-server/review-track-backup-jobs.png" alt-text="Screenshot shows how to view all jobs." lightbox="./media/backup-azure-mysql-flexible-server/review-track-backup-jobs.png"::: |
| 125 | + |
| 126 | + |
| 127 | +## Next steps |
| 128 | + |
| 129 | +- [Restore the Azure Database for MySQL - Flexible Server (preview)](backup-azure-mysql-flexible-server-restore.md). |
| 130 | + |
0 commit comments