|
| 1 | +# Azure MySQL: <br/> Backup (BU) & Disaster Recovery (DR) - Overview |
| 2 | + |
| 3 | +Costa Rica |
| 4 | + |
| 5 | +[](https://github.com) |
| 6 | +[](https://github.com/) |
| 7 | +[brown9804](https://github.com/brown9804) |
| 8 | + |
| 9 | +Last updated: 2025-03-17 |
| 10 | + |
| 11 | +---------- |
| 12 | + |
| 13 | +<details> |
| 14 | +<summary><b>List of References </b> (Click to expand)</summary> |
| 15 | + |
| 16 | +- [Backup and restore in Azure Database for MySQL - Flexible Server](https://learn.microsoft.com/en-us/azure/mysql/flexible-server/concepts-backup-restore) |
| 17 | +- [Back up an Azure Database for MySQL flexible server by using Azure Backup (preview)](https://learn.microsoft.com/en-us/azure/backup/backup-azure-mysql-flexible-server) |
| 18 | +- [Migrate your MySQL database to Azure Database for MySQL - Flexible Server using dump and restore](https://learn.microsoft.com/en-us/azure/mysql/flexible-server/concepts-migrate-dump-restore) |
| 19 | +- [Trigger on-demand backup of an Azure Database for MySQL - Flexible Server instance by using the Azure portal](https://learn.microsoft.com/en-us/azure/mysql/flexible-server/how-to-trigger-on-demand-backup) |
| 20 | + |
| 21 | +</details> |
| 22 | + |
| 23 | +> [!NOTE] |
| 24 | +> Quick reference on how to create an Azure Database for MySQL Flexible Server: |
| 25 | +
|
| 26 | +https://github.com/user-attachments/assets/1c6efd8a-987a-46ac-a81d-6d4ae74b07fd |
| 27 | + |
| 28 | +## Backup (BU) for MySQL on Azure |
| 29 | + |
| 30 | +> [!IMPORTANT] |
| 31 | +> The backup process includes `automated daily snapshot backups and frequent transaction log backups`. The `first snapshot backup is scheduled immediately after the server is created`, and `subsequent snapshots are taken daily. Transaction log backups occur every five minutes, capturing all changes made to the database since the last transaction log backup`. If a scheduled backup fails, the backup service retries every 20 minutes until a successful backup is taken. These backup failures might occur due to heavy transactional production loads on the server instance. In cases of high transaction loads, the backup service may perform multiple backups per day to ensure reliable and quicker restoration using these backups. For MySQL 5.7 servers, long-running or large transactions can prevent global instance-level lock acquisition, which is required for successful daily backups. |
| 32 | +
|
| 33 | +| **Category** | **Description** | |
| 34 | +|-----------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| |
| 35 | +| **Automated Backups** | - **Daily Backups**: Azure Database for MySQL automatically performs daily backups of your databases. These backups are stored in geo-redundant storage (GRS) to ensure high availability.<br/>- **Retention Period**: Configure the retention period for automated backups, typically ranging from 7 to 35 days.<br/>- **Point-in-Time Restore (PITR)**: Restore your database to any point within the retention period, providing flexibility in case of accidental data loss or corruption. | |
| 36 | +| **Manual Backups** | - **On-Demand Backups**: Create manual backups at any time. These backups are stored in GRS and can be used to restore your database to the state at the time of the backup.<br/>- **Exporting Data**: Export your MySQL database using the `mysqldump` utility, which can be stored in Azure Blob Storage or downloaded locally for additional safety. | |
| 37 | +| **Backup Storage** | - **Geo-Redundant Storage (GRS)**: By default, backups are stored in GRS, which replicates data to a secondary region to ensure durability and availability.<br/>- **Locally Redundant Storage (LRS)**: For cost savings, you can opt for LRS, which keeps multiple copies of your data within a single region. | |
| 38 | + |
| 39 | +### Automated Backups |
| 40 | + |
| 41 | +> `Automated Backups` for Azure Database for MySQL ensure that your data is regularly backed up without manual intervention. |
| 42 | +
|
| 43 | +#### Change Backups Retention Policy and Redundancy |
| 44 | + |
| 45 | +> Azure Database for MySQL automatically performs daily snapshot backups of the data files and transaction logs. These backups are stored in geo-redundant storage (GRS) to ensure high availability and durability. |
| 46 | +
|
| 47 | +1. **Access the Azure Portal**: Navigate to the Azure Portal and sign in with your credentials. |
| 48 | +2. **Navigate to Your MySQL Flexible Server**: In the Azure Portal, go to `All resources` and select your Azure Database for MySQL Flexible Server instance. |
| 49 | +3. **Compute + Storage Settings**: In the left-hand menu, under `Settings`, select `Compute + storage`. |
| 50 | +4. **Backup Retention**: |
| 51 | + - In the `Backups` section, you will find the slider labeled `Backup retention period in days`. |
| 52 | + - Use the slider to set the retention period for automated backups, which can range from 7 to 35 days. |
| 53 | + |
| 54 | + https://github.com/user-attachments/assets/769fa81a-450f-4cd9-a4d9-8f4f227c01c9 |
| 55 | + |
| 56 | +5. **Backup Redundancy**: |
| 57 | + - Below the retention slider, you will see options for backup redundancy: |
| 58 | + - **Locally-redundant**: Keeps multiple copies of your data within a single region. |
| 59 | + - **Geo-redundant**: Replicates data to a secondary region to ensure durability and availability. |
| 60 | + - **Read-access geo-redundant**: Provides read access to the replicated data in the secondary region. |
| 61 | + - Select the desired redundancy option based on your requirements. |
| 62 | + |
| 63 | + https://github.com/user-attachments/assets/ea53958a-ca3e-4100-a527-d0e46cdb992e |
| 64 | + |
| 65 | + |
| 66 | +### Manual Backups |
| 67 | + |
| 68 | +> `Manual Backups` provide additional control over backup operations, allowing you to create backups on demand. |
| 69 | +
|
| 70 | +> [!IMPORTANT] |
| 71 | +> These backup files cannot be exported. The backups can only be used for restore operations in Azure Database for MySQL Flexible Server. You can also use [mysqldump](https://learn.microsoft.com/en-us/azure/mysql/flexible-server/concepts-migrate-dump-restore#dump-and-restore-using-mysqldump-utility) from a MySQL client to copy a database. |
| 72 | +
|
| 73 | +#### On-Demand Backups |
| 74 | + |
| 75 | +> You can create manual backups at any time. These backups are stored in geo-redundant storage (GRS) and can be used to restore your database to the state at the time of the backup. |
| 76 | +
|
| 77 | +1. **Access the Azure Portal**: Navigate to your Azure Database for MySQL instance. |
| 78 | +2. **Backup Settings**: Under the `Settings` section, select `Backup and Restore`. |
| 79 | + |
| 80 | + <img width="550" alt="image" src="https://github.com/user-attachments/assets/e4aab7b9-4d16-4a5c-8817-6ccab7ec555e" /> |
| 81 | + |
| 82 | +3. **Backup Now**: Click on `Backup` and provide a custom name for the backup. |
| 83 | + |
| 84 | + <img width="550" alt="image" src="https://github.com/user-attachments/assets/756a6512-267e-47a4-a2c5-4b182f4f28bd" /> |
| 85 | + |
| 86 | + https://github.com/user-attachments/assets/0f3743ca-9098-45a4-82c9-e67593e4ffcc |
| 87 | + |
| 88 | +### Backup Storage |
| 89 | + |
| 90 | + |
| 91 | +## Disaster Recovery (DR) for MySQL on Azure |
| 92 | + |
| 93 | +<div align="center"> |
| 94 | + <h3 style="color: #4CAF50;">Total Visitors</h3> |
| 95 | + <img src="https://profile-counter.glitch.me/brown9804/count.svg" alt="Visitor Count" style="border: 2px solid #4CAF50; border-radius: 5px; padding: 5px;"/> |
| 96 | +</div> |
0 commit comments