|
1 | 1 | ---
|
2 |
| -title: Backup and restore for Azure Database for PostgreSQL server |
3 |
| -description: Explains how to back up and restore for Azure Database for PostgreSQL servers |
| 2 | +title: Automated backup for Azure Arc-enabled PostgreSQL server |
| 3 | +description: Explains how to configure backups for Azure Arc-enabled PostgreSQL server |
4 | 4 | services: azure-arc
|
5 | 5 | ms.service: azure-arc
|
6 | 6 | ms.subservice: azure-arc-data-postgresql
|
7 | 7 | author: dhanmm
|
8 | 8 | ms.author: dhmahaja
|
9 | 9 | ms.reviewer: mikeray
|
10 |
| -ms.date: 11/03/2021 |
| 10 | +ms.date: 03/12/2023 |
11 | 11 | ms.topic: how-to
|
12 | 12 | ---
|
13 | 13 |
|
14 |
| -# Back up and restore Azure Arc-enabled PostgreSQL servers |
| 14 | +# Automated backup Azure Arc-enabled PostgreSQL servers |
15 | 15 |
|
16 |
| -Automated backups can be enabled by including the `--storage-class-backups` argument when creating an Azure Arc-enabled PostgreSQL server. Specify the retention period for backups with the `--retention-days` parameter, when creating or updating an Arc-enabled PostgreSQL server. The retention period can be between 0 and 35 days. If backups are enabled but no retention period is specified, the default is seven days. |
| 16 | +To enable automated backups, include the `--storage-class-backups` argument when you create an Azure Arc-enabled PostgreSQL server. Specify the retention period for backups with the `--retention-days` parameter. Use this parameter when you create or update an Arc-enabled PostgreSQL server. The retention period can be between 0 and 35 days. If backups are enabled but no retention period is specified, the default is seven days. |
17 | 17 |
|
18 |
| -Restoring an Azure Arc-enable PostgreSQL server creates a new server by copying the configuration of the existing server (for example resource requests/limits, extensions etc.). Configurations that could cause conflicts (for example primary endpoint port) aren't copied. The storage configuration for the new resource can be defined by passing `--storage-class*` and `--volume-size-*` parameters to the `restore` command. |
| 18 | +Additionally, if you set the retention period to zero, then automated backups are disabled. |
19 | 19 |
|
20 |
| -Restore an Azure Arc-enabled PostgreSQL server to a new server with the `restore` command: |
21 |
| -```azurecli |
22 |
| -az postgres server-arc restore -n <destination-server-name> --source-server <source-server-name> --k8s-namespace <namespace> --use-k8s |
23 |
| -``` |
| 20 | +[!INCLUDE [azure-arc-data-preview](../../../includes/azure-arc-data-preview.md)] |
24 | 21 |
|
25 |
| -## Examples: |
| 22 | +## Create server with automated backup |
26 | 23 |
|
27 |
| -Create a new Arc-enabled PostgreSQL server `pg02` by restoring `pg01` using the latest backups: |
28 |
| -```azurecli |
29 |
| -az postgres server-arc restore -n pg02 --source-server pg01 --k8s-namespace arc --use-k8s |
30 |
| -``` |
| 24 | +Create an Azure Arc-enabled PostgreSQL server with automated backups: |
31 | 25 |
|
32 |
| -Create a new Arc-enabled PostgreSQL server `pg02` by restoring `pg01` using the latest backups, defining new storage requirements for pg02: |
33 | 26 | ```azurecli
|
34 |
| -az postgres server-arc restore -n pg02 --source-server pg01 --k8s-namespace arc --storage-class-data azurefile-csi-premium --volume-size-data 10Gi --storage-class-logs azurefile-csi-premium --volume-size-logs 2Gi--use-k8s --storage-class-backups azurefile-csi-premium --volume-size-backups 15Gi |
| 27 | +az postgres server-arc create -n <name> -k <namespace> --storage-class-backups <storage-class> --retention-days <number of days> --use-k8s |
35 | 28 | ```
|
36 | 29 |
|
37 |
| -Create a new Arc-enabled PostgreSQL server `pg02` by restoring `pg01` to its state at `2023-02-01T00:00:00Z`: |
38 |
| -```azurecli |
39 |
| -az postgres server-arc restore -n pg02 --source-server pg01 --k8s-namespace arc -t 2023-02-01T00:00:00Z --use-k8s |
40 |
| -``` |
| 30 | +## Update a server to set retention period |
| 31 | + |
| 32 | +Update the backup retention period for an Azure Arc-enabled PostgreSQL server: |
41 | 33 |
|
42 |
| -For details about all the parameters available for restore review the output of the command: |
43 | 34 | ```azurecli
|
44 |
| -az postgres server-arc restore --help |
| 35 | +az postgres server-arc update -n pg01 -k test --retention-days <number of days> --use-k8s |
45 | 36 | ```
|
46 | 37 |
|
47 |
| -- Read about [scaling up or down (increasing/decreasing memory/vcores)](scale-up-down-postgresql-server-using-cli.md) your server. |
| 38 | +## Next steps |
| 39 | + |
| 40 | +- [Restore Azure Arc-enabled PostgreSQL servers](restore-postgresql.md) |
| 41 | +- [Scaling up or down (increasing/decreasing memory/vcores)](scale-up-down-postgresql-server-using-cli.md) your server. |
0 commit comments