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
@@ -135,7 +138,7 @@ As compared to other backup solutions, pg_probackup offers the following benefit
135
138
- Backup from replica: avoid extra load on the master server by taking backups from a standby
136
139
- External directories: add to backup content of directories located outside of the PostgreSQL data directory (PGDATA), such as scripts, configs, logs and pg_dump files
137
140
- Backup Catalog: get list of backups and corresponding meta information in `plain` or `json` formats and view WAL Archive information.
138
-
- Partial Restore: restore the only specified databases or skip the specified databases.
141
+
- Partial Restore: restore only the specified databases or skip the specified databases.
139
142
140
143
To manage backup data, pg_probackup creates a `backup catalog`. This is a directory that stores all backup files with additional meta information, as well as WAL archives required for point-in-time recovery. You can store backups for different instances in separate subdirectories of a single backup catalog.
141
144
@@ -280,7 +283,7 @@ Since pg_probackup needs to read cluster files directly, pg_probackup must be st
280
283
281
284
Depending on whether you are plan to take [autonomous](#stream-mode) and/or [archive](#archive-mode) backups, PostgreSQL cluster configuration will differ, as specified in the sections below. To back up the database cluster from a standby server, run pg_probackup in remote mode or create PTRACK backups, additional setup is required.
282
285
283
-
For details, see the sections [Setting up STREAM Backups](#setting-up-stream-backups), [Setting up continuous WAL archiving](#setting-up-continuous-wal-archiving), [Setting up Backup from Standby](#setting-up-backup-from-standby), [Configuring the Remote Mode](#configuring-the-remote-mode) and [Setting up PTRACK Backups](#setting-up-ptrack-backups).
286
+
For details, see the sections [Setting up STREAM Backups](#setting-up-stream-backups), [Setting up continuous WAL archiving](#setting-up-continuous-wal-archiving), [Setting up Backup from Standby](#setting-up-backup-from-standby), [Configuring the Remote Mode](#configuring-the-remote-mode), [Setting up Partial Restore](#setting-up-partial-restore) and [Setting up PTRACK Backups](#setting-up-ptrack-backups).
284
287
285
288
### Setting up STREAM Backups
286
289
@@ -356,19 +359,13 @@ GRANT EXECUTE ON FUNCTION bt_index_check(oid) TO backup;
356
359
GRANT EXECUTE ON FUNCTION bt_index_check(oid, bool) TO backup;
357
360
```
358
361
359
-
### Setting up PTRACK Backups
360
-
361
-
Backup mode PTACK can be used only on Postgrespro Standart and Postgrespro Enterprise installations or patched vanilla PostgreSQL. Links to ptrack patches can be found [here](https://github.com/postgrespro/pg_probackup#ptrack-support).
362
+
### Setting up Partial Restore
362
363
363
-
If you are going to use PTRACK backups, complete the following additional steps:
364
-
365
-
- Set the parameter `ptrack_enable` to `on`.
366
-
- Grant the rights to execute `ptrack` functions to the *backup* role **in every database** of the cluster:
364
+
If you are plalling to use partial restore, complete the following additional step:
367
365
368
-
GRANT EXECUTE ON FUNCTION pg_catalog.pg_ptrack_clear() TO backup;
369
-
GRANT EXECUTE ON FUNCTION pg_catalog.pg_ptrack_get_and_clear(oid, oid) TO backup;
366
+
- Grant the read-only acces to 'pg_catalog.pg_database' to the *backup* role only in database **used for connection** to PostgreSQL server:
370
367
371
-
- The *backup* role must have access to all the databases of the cluster.
368
+
GRANT SELECT ON TABLE pg_catalog.pg_database TO backup;
372
369
373
370
### Configuring the Remote Mode
374
371
@@ -408,6 +405,20 @@ pg_probackup in remote mode via `ssh` works as follows:
408
405
409
406
>NOTE: You can improse [additional restrictions](https://man.openbsd.org/OpenBSD-current/man8/sshd.8#AUTHORIZED_KEYS_FILE_FORMAT) on ssh settings to protect the system in the event of account compromise.
410
407
408
+
### Setting up PTRACK Backups
409
+
410
+
Backup mode PTACK can be used only on Postgrespro Standart and Postgrespro Enterprise installations or patched vanilla PostgreSQL. Links to ptrack patches can be found [here](https://github.com/postgrespro/pg_probackup#ptrack-support).
411
+
412
+
If you are going to use PTRACK backups, complete the following additional steps:
413
+
414
+
- Set the parameter `ptrack_enable` to `on`.
415
+
- Grant the rights to execute `ptrack` functions to the *backup* role **in every database** of the cluster:
416
+
417
+
GRANT EXECUTE ON FUNCTION pg_catalog.pg_ptrack_clear() TO backup;
418
+
GRANT EXECUTE ON FUNCTION pg_catalog.pg_ptrack_get_and_clear(oid, oid) TO backup;
419
+
420
+
- The *backup* role must have access to all the databases of the cluster.
421
+
411
422
## Usage
412
423
413
424
### Creating a Backup
@@ -1821,6 +1832,111 @@ Deprecated. User name to connect as.
1821
1832
Default: 300 sec
1822
1833
Deprecated. Wait time for WAL segment streaming via replication, in seconds. By default, pg_probackup waits 300 seconds. You can also define this parameter in the pg_probackup.conf configuration file using the [set-config](#set-config) command.
1823
1834
1835
+
## Howto
1836
+
1837
+
All exaples below assume the remote mode of operations via `ssh`. If you are planning to run backup and restore operation locally then step `Setup passwordless SSH connection` can be skipped and all `--remote-*` options can be ommited.
1838
+
1839
+
Examples are based on Ubuntu 18.04, PostgreSQL 11 and pg_probackup 2.2.0.
1840
+
1841
+
backup_host - host with backup catalog.
1842
+
backupman - user on `backup_host` running all pg_probackup operations.
1843
+
/mnt/backups - directory on `backup_host` where backup catalog is stored.
1844
+
1845
+
postgres_host - host with PostgreSQL cluster.
1846
+
postgres - user on `postgres_host` which run PostgreSQL cluster.
1847
+
/var/lib/postgresql/11/main - directory on `postgres_host` where PGDATA of PostgreSQL cluster is located.
1848
+
backup_db - database used for connection to PostgreSQL cluster.
1849
+
1850
+
### Minimal Setup
1851
+
1852
+
This setup is relying on autonomous FULL and DELTA backups.
1853
+
1854
+
1. Setup passwordless SSH connection from `backup_host` to `postgres_host`:
Currently the latest documentation can be found at [github](https://postgrespro.github.io/pg_probackup).
116
116
Slightly outdated documentation can be found at [Postgres Pro Enterprise documentation](https://postgrespro.com/docs/postgrespro/current/app-pgprobackup).
117
-
Documentation for current devel can also be found at [github](https://github.com/postgrespro/pg_probackup/blob/master/Documentation.md)
117
+
Documentation for current devel can also be found at [github](https://github.com/postgrespro/pg_probackup/blob/master/Documentation.md).
0 commit comments