Back up Azure Database for PostgreSQL Flexible server with long-term retention (preview)
This article describes how to back up Azure Database for PostgreSQL Flexible Server.
Prerequisites
Before you configure backup for Azure Database for PostgreSQL Flexible server:
- Review the supported scenarios and known limitations of Azure Database for PostgreSQL Flexible server backup.
- Ensure that you have the required permissions for the backup operation.
Configure backup
To configure backup on the Azure Database for PostgreSQL Flexible Server databases using Azure Backup, follow these steps:
Create a Backup vault.
Go to Backup vault > +Backup.
Alternatively, go to Backup center and select +Backup.
Select the data source type as Azure Database for PostgreSQL flexible servers (Preview).
Select or create a Backup Policy to define the backup schedule and the retention duration.
Select Next then select Add to select the Azure Database for PostgreSQL Flexible Server that you want to back up.
Choose one of the Azure Database for PostgreSQL Flexible Servers across subscriptions if they're in the same region as that of the vault. Expand the arrow to see the list of databases within a server.
After the selection, the validation starts. The backup readiness check ensures the vault has sufficient permissions for backup operations. Resolve any access issues by granting appropriate permissions to the vault MSI and re-triggering the validation.
Submit the configure backup operation and track the progress under Backup instances.
Create a backup policy
To create a backup policy, follow these steps:
In the Backup vault you created, go to Backup policies and select Add. Alternatively, go to Backup center > Backup policies > Add.
Enter a name for the new policy.
Select the data source type as Azure Database for PostgreSQL flexible servers (Preview).
Specify the Backup schedule.
Currently, only Weekly backup option is available. However, you can schedule the backups on multiple days of the week.
Specify Retention settings.
You can add one or more retention rules. Each retention rule assumes inputs for specific backups, and data store and retention duration for those backups.
Note
Retention duration ranges from seven days to 10 years in the Backup data store.
Note
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.
Run an on-demand backup
To trigger a backup not in the schedule specified in the policy, go to Backup instances > Backup Now. Choose from the list of retention rules that were defined in the associated Backup policy.
Track a backup job
Azure Backup service creates a job for scheduled backups or if you trigger on-demand backup operation for tracking.
To view the backup job status:
Go to the Backup instance screen.
It shows the jobs dashboard with operation and status for the past seven days.
To view the status of the backup job, select View all to see ongoing and past jobs of this backup instance.
Next steps
Restore Azure Database for PostgreSQL Flexible backups (preview)