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
*[Using pg_probackup in the Remote Mode](#using-pg_probackup-in-the-remote-mode)
34
37
*[Running pg_probackup on Parallel Threads](#running-pg_probackup-on-parallel-threads)
@@ -125,6 +128,7 @@ As compared to other backup solutions, pg_probackup offers the following benefit
125
128
- Backup from replica: avoid extra load on the master server by taking backups from a standby
126
129
- 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
127
130
- Backup Catalog: get list of backups and corresponding meta information in `plain` or `json` formats
131
+
- Partial Restore: restore the only specified databases or skip the specified databases.
128
132
129
133
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.
130
134
@@ -518,6 +522,26 @@ If *backup_id* belong to incremental backup, then all its parents starting from
518
522
519
523
If you omit all the parameters, all backups are validated.
520
524
525
+
#### Partial Validation
526
+
527
+
If you have enabled [partial restore](#setting-up-partial-restore) before taking backups, you can validate or exclude from validation the arbitraty number of specific databases using [partial restore options](#partial-restore-options) with the [validate](#validate) command.
528
+
529
+
To validate only one or more databases, run the `validate` command with the following options:
The option `--db-exclude` can be specified multiple times. For example, to exclude the databases "db1" and "db2" from validation, run the following command:
To restore the database cluster from a backup, run the restore command with at least the following options:
@@ -542,6 +566,30 @@ If you are restoring an STREAM backup, the restore is complete at once, with the
542
566
543
567
>NOTE: By default, the [restore](#restore) command validates the specified backup before restoring the cluster. If you run regular backup validations and would like to save time when restoring the cluster, you can specify the `--no-validate` flag to skip validation and speed up the recovery.
544
568
569
+
#### Partial Restore
570
+
571
+
If you have enabled [partial restore](#setting-up-partial-restore) before taking backups, you can restore or exclude from restore the arbitraty number of specific databases using [partial restore options](#partial-restore-options) with the [restore](#restore) commands.
572
+
573
+
To restore only one or more databases, run the restore command with the following options:
The option `--db-exclude` can be specified multiple times. For example, to exclude the databases `db1` and `db2` from restore, run the following command:
Partial restore rely on lax behaviour of PostgreSQL recovery process toward truncated files. Files of excluded databases restored as null sized files, allowing recovery to work properly. After successfull starting of PostgreSQL cluster, you must drop excluded databases using `DROP DATABASE` command.
590
+
591
+
>NOTE: The databases `template0` and `template1` are always restored.
592
+
545
593
### Performing Point-in-Time (PITR) Recovery
546
594
547
595
If you have enabled [continuous WAL archiving](#setting-up-continuous-wal-archiving) before taking backups, you can restore the cluster to its state at an arbitrary point in time (recovery target) using [recovery target options](#recovery-target-options) with the [restore](#restore) and [validate](#validate) commands.
@@ -1009,6 +1057,7 @@ For details on usage, see the section [Creating a Backup](#creating-a-backup).
Restores the PostgreSQL instance from a backup copy located in the *backup_dir* backup catalog. If you specify a [recovery target option](#recovery-target-options), pg_probackup will find the closest backup and restores it to the specified recovery target. Otherwise, the most recent backup is used.
1014
1063
@@ -1032,7 +1081,7 @@ Disables block-level checksum verification to speed up validation. During automa
1032
1081
--no-validate
1033
1082
Skips backup validation. You can use this flag if you validate backups regularly and would like to save time when running restore operations.
1034
1083
1035
-
Additionally [Recovery Target Options](#recovery-target-options), [Remote Mode Options](#remote-mode-options), [Logging Options](#logging-options) and [Common Options](#common-options) can be used.
1084
+
Additionally [Recovery Target Options](#recovery-target-options), [Remote Mode Options](#remote-mode-options), [Logging Options](#logging-options), [Partial Restore](#partial-restore) and [Common Options](#common-options) can be used.
1036
1085
1037
1086
For details on usage, see the section [Restoring a Cluster](#restoring-a-cluster).
1038
1087
@@ -1065,9 +1114,12 @@ For details on usage, see the section [Verifying a Cluster](#verifying-a-cluster
Verifies that all the files required to restore the cluster are present and not corrupted. If *instance_name* is not specified, pg_probackup validates all backups available in the backup catalog. If you specify the *instance_name* without any additional options, pg_probackup validates all the backups available for this backup instance. If you specify the *instance_name* with a [recovery target options](#recovery-target-options) and/or a *backup_id*, pg_probackup checks whether it is possible to restore the cluster using these options.
1069
1121
1070
-
Verifies that all the files required to restore the cluster are present and not corrupted. If *instance_name* is not specified, pg_probackup validates all backups available in the backup catalog. If you specify the *instance_name* without any additional options, pg_probackup validates all the backups available for this backup instance. If you specify the *instance_name* with a [recovery target option](#recovery-target-options) and/or a *backup_id*, pg_probackup checks whether it is possible to restore the cluster using these options.
1122
+
If you specify the [partial restore options](#partial-restore-options) and a *backup_id*, pg_probackup checks whether it is possible to restore the cluster using these options.
1071
1123
1072
1124
For details, see the section [Validating a Backup](#validating-a-backup).
1073
1125
@@ -1354,6 +1406,16 @@ Specifies pg_probackup installation directory on the remote system.
1354
1406
--ssh-options=ssh_options
1355
1407
Specifies a string of SSH command-line options. For example, the following options can used to set keep-alive for ssh connections opened by pg_probackup: `--ssh-options='-o ServerAliveCountMax=5 -o ServerAliveInterval=60'`. Full list of possible options can be found on [ssh_config manual page](https://man.openbsd.org/ssh_config.5).
1356
1408
1409
+
#### Partial Restore Options
1410
+
1411
+
This section describes the options related to partial restore of cluster from backup. These options can be used with [restore](#restore) and [validate](#validate) commands.
1412
+
1413
+
--db-exclude=dbname
1414
+
Specifies database name to exclude from restore. All other databases in the cluster will be restored as usual, including `template0` and `template1`. This option can be specified multiple times for multiple databases.
1415
+
1416
+
--db-include=dbname
1417
+
Specifies database name to restore from backup. All other databases in the cluster will not be restored, with exception of `template0` and `template1`. This option can be specified multiple times for multiple databases.
1418
+
1357
1419
#### Replica Options
1358
1420
1359
1421
This section describes the options related to taking a backup from standby.
0 commit comments