You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This article provides a conceptual overview of long-term retention of backups for Azure SQL Database and Azure SQL Managed Instance. Long-term retention can be configured for up to 10 years on backups for Azure SQL Database (including in the Hyperscale service tier), and Azure SQL Managed Instance.
18
18
@@ -26,7 +26,7 @@ By using the LTR feature, you can store specified full SQL Database and SQL Mana
26
26
27
27
> [!NOTE]
28
28
> - It's not currently possible to configure backups of Azure SQL Database and Azure SQL Managed Instance as [immutable](/azure/storage/blobs/immutable-storage-overview).
29
-
> - In Azure SQL Managed Instance, use SQL Agent jobs to schedule [copy-only database backups](/sql/relational-databases/backup-restore/copy-only-backups-sql-server) as an alternative to LTR beyond 35 days.
29
+
> - In Azure SQL Managed Instance, use SQL Agent jobs to schedule [copy-only database backups](/sql/relational-databases/backup-restore/copy-only-backups-sql-server?view=azuresqldb-mi-current&preserve-view=true) as an alternative to LTR beyond 35 days.
30
30
31
31
To enable LTR, you can define a policy using a combination of four parameters: weekly backup retention (W), monthly backup retention (M), yearly backup retention (Y), and week of the year (WeekOfYear). If you specify W, one backup every week is copied to long-term storage. If you specify M, the first backup of each month is copied to the long-term storage. If you specify Y, one backup during the week specified by WeekOfYear is copied to the long-term storage. If the specified WeekOfYear is in the past when the policy is configured, the first LTR backup is created the following year. Each backup is kept in long-term storage according to the policy parameters that are configured when the LTR backup is created.
32
32
@@ -54,12 +54,41 @@ The following table illustrates the cadence and expiration of the long-term back
54
54
55
55
`W=12 weeks` (84 days), `M=12 months` (365 days), `Y=10 years` (3650 days), `WeekOfYear=20` (the week after May 13)
56
56
57
-
:::image type="content" source="media/long-term-retention-overview/ltr-example.png" alt-text="Diagram showing an example of Long-term retention.":::
57
+
The following dates are in ISO 8601 (`YYYY-MM-DD`).
58
+
59
+
|**PITR backup to LTR**|**Expiration W**|**Expiration M**|**Expiration Y**|
60
+
|:--|:--|:--|:--|
61
+
|**2018-03-07**|| 2019-07-03 ||
62
+
|2018-03-14 | 2018-06-06 |||
63
+
|2018-03-21 | 2018-06-13 |||
64
+
|2018-03-28 | 2018-06-20 |||
65
+
|**2018-04-04**|| 2019-04-25 ||
66
+
|2018-04-11 | 2018-07-04 |||
67
+
|2018-04-18 | 2018-07-11 |||
68
+
|2018-04-25 | 2018-07-18 |||
69
+
|**2018-05-02**|| 2019-05-23 ||
70
+
|2018-05-09 | 2018-08-01 |||
71
+
|**2018-05-16**||| 2028-05-13 |
72
+
|2018-05-23 | 2018-08-15 |||
73
+
|2018-05-30 | 2018-08-22 |||
74
+
|**2018-06-06**|| 2019-06-20 ||
75
+
|2018-06-13 | 2018-09-05 |||
76
+
|2018-06-20 | 2018-09-12 |||
77
+
|2018-06-27 | 2018-09-19 |||
78
+
|**2018-07-04**|| 2019-07-25 ||
79
+
|2018-07-11 | 2018-10-03 |||
80
+
|2018-07-18 | 2018-10-10 |||
81
+
|2018-07-25 | 2018-10-17 |||
82
+
|**2018-08-01**|| 2019-08-22 ||
83
+
|2018-08-08 | 2018-10-31 |||
84
+
|2018-08-15 | 2018-11-07 |||
85
+
|2018-08-22 | 2018-11-14 |||
86
+
|2018-08-29 | 2018-11-21 |||
58
87
59
88
If you modify the above policy and set `W=0` (no weekly backups), the service only retains the monthly and yearly backups. No weekly backups are stored under the LTR policy. The storage amount needed to keep these backups reduces accordingly.
60
89
61
90
> [!IMPORTANT]
62
-
> The timing of individual LTR backups is controlled by Azure SQL Database. You cannot manually create an LTR backup or control the timing of the backup creation. After configuring an LTR policy, it may take up to 7 days before the first LTR backup will show up on the list of available backups.
91
+
> The timing of individual LTR backups is controlled by Azure SQL Database. You cannot manually create an LTR backup or control the timing of the backup creation. After configuring an LTR policy, it might take up to 7 days before the first LTR backup will show up on the list of available backups.
63
92
>
64
93
> If you delete a logical server or a managed instance, all databases on that server or managed instance are also deleted and can't be recovered. You can't restore a deleted server or managed instance. However, if you had configured LTR for a database or managed instance, LTR backups are not deleted, and they can be used to restore databases on a different server or managed instance in the same subscription, to a point in time when an LTR backup was taken.
65
94
>
@@ -76,9 +105,9 @@ If you're using active geo-replication or failover groups as your business conti
76
105
77
106
You can configure long-term backup retention using the Azure portal and PowerShell for Azure SQL Database and Azure SQL Managed Instance. To restore a database from the LTR storage, you can select a specific backup based on its timestamp. The database can be restored to any existing server or managed instance under the same subscription as the original database.
78
107
79
-
To learn how to configure long-term retention or restore a database from backup for SQL Database using the Azure portal or PowerShell, see [Manage Azure SQL Database long-term backup retention](long-term-backup-retention-configure.md).
108
+
To learn how to configure long-term retention or restore a database from backup for SQL Database using the Azure portal or PowerShell, see [Manage Azure SQL Database long-term backup retention](long-term-backup-retention-configure.md?view=azuresql-db&preserve-view=true).
80
109
81
-
To learn how to configure long-term retention or restore a database from backup for SQL Managed Instance using the Azure portal or PowerShell, see [Manage Azure SQL Managed Instance long-term backup retention](../managed-instance/long-term-backup-retention-configure.md).
110
+
To learn how to configure long-term retention or restore a database from backup for SQL Managed Instance using the Azure portal or PowerShell, see [Manage Azure SQL Managed Instance long-term backup retention](../managed-instance/long-term-backup-retention-configure.md?view=azuresql-mi&preserve-view=true).
82
111
83
112
When a restore request is initiated in the final 7 days of the LTR retention period, Azure will automatically extend the expiration date of all backups +7 days, to prevent an LTR backup from expiring during the restore.
84
113
@@ -96,5 +125,5 @@ Because database backups protect data from accidental corruption or deletion, th
96
125
97
126
For a tutorial on configuring and managing LTR backups, visit:
0 commit comments