Skip to content

Commit 214ec3f

Browse files
authored
Merge pull request #230316 from MikeRayMSFT/20230310-add-postgres-features
Update features for PostgreSQL
2 parents 5a286a8 + d9ce97a commit 214ec3f

6 files changed

+93
-25
lines changed
Lines changed: 18 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,41 @@
11
---
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
44
services: azure-arc
55
ms.service: azure-arc
66
ms.subservice: azure-arc-data-postgresql
77
author: dhanmm
88
ms.author: dhmahaja
99
ms.reviewer: mikeray
10-
ms.date: 11/03/2021
10+
ms.date: 03/12/2023
1111
ms.topic: how-to
1212
---
1313

14-
# Back up and restore Azure Arc-enabled PostgreSQL servers
14+
# Automated backup Azure Arc-enabled PostgreSQL servers
1515

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.
1717

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.
1919

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)]
2421

25-
## Examples:
22+
## Create server with automated backup
2623

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:
3125

32-
Create a new Arc-enabled PostgreSQL server `pg02` by restoring `pg01` using the latest backups, defining new storage requirements for pg02:
3326
```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
3528
```
3629

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:
4133

42-
For details about all the parameters available for restore review the output of the command:
4334
```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
4536
```
4637

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.

articles/azure-arc/data/configure-security-postgresql.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,10 @@ To configure roles and users in your Azure Arc-enabled PostgreSQL server, use th
169169

170170
For audit scenarios please configure your server group to use the `pgaudit` extensions of Postgres. For more details about `pgaudit` see [`pgAudit` GitHub project](https://github.com/pgaudit/pgaudit/blob/master/README.md). To enable the `pgaudit` extension in your server group read [Use PostgreSQL extensions](using-extensions-in-postgresql-server.md).
171171

172+
## Use SSL connection
173+
174+
SSL is required for client connections. In connection string, the SSL mode parameter should not be disabled. [Form connection strings](get-connection-endpoints-and-connection-strings-postgresql-server.md#form-connection-strings).
175+
172176
## Next steps
173177
- See [`pgcrypto` extension](https://www.postgresql.org/docs/current/pgcrypto.html)
174178
- See [Use PostgreSQL extensions](using-extensions-in-postgresql-server.md)

articles/azure-arc/data/deploy-active-directory-postgresql-server-cli.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ Before you proceed, install the following tools:
2828

2929
To know more further details about how to set up OU and AD account, go to [Deploy Azure Arc-enabled data services in Active Directory authentication - prerequisites](active-directory-prerequisites.md)
3030

31+
> [!IMPORTANT]
32+
> When using Active Directory, the default account must be named "postgres" in order for connections to succeed.
3133
3234
## Deploy and update Active Directory integrated Azure Arc-enabled PostgreSQL server
3335

articles/azure-arc/data/get-connection-endpoints-and-connection-strings-postgresql-server.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ Use these end points to:
6464
- Access the Grafana and Kibana dashboards from your browser
6565

6666
For example, you can use the end point named _PostgreSQL Instance_ to connect with psql to your server group:
67+
6768
```console
6869
psql postgresql://postgres:[email protected]:5432
6970
psql (10.14 (Ubuntu 10.14-0ubuntu0.18.04.1), server 12.4 (Ubuntu 12.4-1.pgdg16.04+1))
@@ -80,6 +81,7 @@ postgres=#
8081
8182

8283
## From CLI with kubectl
84+
8385
```console
8486
kubectl get postgresqls/<server name> -n <namespace name>
8587
```
@@ -100,6 +102,9 @@ postgres01 Ready 3/3 12.345.567.89:5432 9d
100102

101103
Use the connections string examples below for your server group. Copy, paste, and customize them as needed:
102104

105+
> [!IMPORTANT]
106+
> SSL is required for client connections. In connection string, the SSL mode parameter should not be disabled. For more information, review [https://www.postgresql.org/docs/14/runtime-config-connection.html](https://www.postgresql.org/docs/14/runtime-config-connection.html).
107+
103108
### ADO.NET
104109

105110
```ado.net
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
---
2+
title: Restore Azure Arc-enabled PostgreSQL server
3+
description: Explains how to restore Arc-enabled PostgreSQL server. You can restore to a point-in-time or restore a whole server.
4+
services: azure-arc
5+
ms.service: azure-arc
6+
ms.subservice: azure-arc-data-postgresql
7+
author: dhanmm
8+
ms.author: dhmahaja
9+
ms.reviewer: mikeray
10+
ms.date: 03/13/2023
11+
ms.topic: how-to
12+
---
13+
14+
# Restore Azure Arc-enabled PostgreSQL servers
15+
16+
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.
17+
18+
[!INCLUDE [azure-arc-data-preview](../../../includes/azure-arc-data-preview.md)]
19+
20+
Restore an Azure Arc-enabled PostgreSQL server to a new server with the `restore` command:
21+
22+
```azurecli
23+
az postgres server-arc restore -n <destination-server-name> --source-server <source-server-name> --k8s-namespace <namespace> --use-k8s
24+
```
25+
26+
## Examples
27+
28+
### Restore using latest backups
29+
30+
Create a new Arc-enabled PostgreSQL server `pg02` by restoring `pg01` using the latest backups:
31+
32+
```azurecli
33+
az postgres server-arc restore -n pg02 --source-server pg01 --k8s-namespace arc --use-k8s
34+
```
35+
36+
### Restore using latest backup and modify the storage requirement
37+
38+
Create a new Arc-enabled PostgreSQL server `pg02` by restoring `pg01` using the latest backups, defining new storage requirements for pg02:
39+
40+
```azurecli
41+
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
42+
```
43+
44+
### Restore to a specific point in time
45+
46+
Create a new Arc-enabled PostgreSQL server `pg02` by restoring `pg01` to its state at `2023-02-01T00:00:00Z`:
47+
```azurecli
48+
az postgres server-arc restore -n pg02 --source-server pg01 --k8s-namespace arc -t 2023-02-01T00:00:00Z --use-k8s
49+
```
50+
51+
## Help
52+
53+
For details about all the parameters available for restore review the output of the command:
54+
```azurecli
55+
az postgres server-arc restore --help
56+
```
57+
58+
## Next steps
59+
60+
- [Configure automated backup - Azure Arc-enabled PostgreSQL servers](backup-restore-postgresql.md)
61+
- [Scaling up or down (increasing/decreasing memory/vcores)](scale-up-down-postgresql-server-using-cli.md) your server.

articles/azure-arc/data/toc.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -258,8 +258,10 @@ items:
258258
items:
259259
- name: Deploy PostgresSQL server - CLI
260260
href: deploy-active-directory-postgresql-server-cli.md
261-
- name: Back up and restore
261+
- name: Automated backup and restore
262262
href: backup-restore-postgresql.md
263+
- name: Restore
264+
href: restore-postgresql.md
263265
- name: Change PostgreSQL port
264266
href: change-postgresql-port.md
265267
- name: Configure and scale

0 commit comments

Comments
 (0)