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
[Issue #102] New options for 'restore' command used for setting 'restore_command' GUC in recovery.conf: '--archive-host', '--archive-post', 'archive-user' and '--restore-command'
@@ -546,6 +547,8 @@ Once the restore command is complete, start the database service.
546
547
547
548
If you are restoring an STREAM backup, the restore is complete at once, with the cluster returned to a self-consistent state at the point when the backup was taken. For ARCHIVE backups, PostgreSQL replays all available archived WAL segments, so the cluster is restored to the latest state possible. You can change this behavior by using the [recovery target options](#recovery-target-options) with the `restore` command. Note that using the [recovery target options](#recovery-target-options) when restoring STREAM backup is possible if the WAL archive is available at least starting from the time the STREAM backup was taken.
548
549
550
+
To restore cluster on remote host see the section [Using pg_probackup in the Remote Mode](#using-pg-probackup-in-the-remote-mode).
551
+
549
552
>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.
550
553
551
554
#### Partial Restore
@@ -624,6 +627,24 @@ For example, to restore latest backup on remote system using remote mode through
Restoring of ARCHIVE backup or performing PITR in remote mode require additional information: destination address, port and username for establishing ssh connection **from** a host with database **to** a host with backup catalog. This information will be used by `restore_command` to copy via ssh WAL segments from archive to PostgreSQL 'pg_wal' directory.
631
+
632
+
To solve this problem you can use [Remote Wal Archive Options](#remote-wal-archive-options).
633
+
634
+
For example, to restore latest backup on remote system using remote mode through SSH connection to user `postgres` on host with address `192.168.0.2` via port `2302` and user `backup` on backup catalog host with address `192.168.0.3` via port `2303`, run:
>NOTE: The remote backup mode is currently unavailable for Windows systems.
628
649
629
650
### Running pg_probackup on Parallel Threads
@@ -1054,7 +1075,7 @@ The sample output is as follows:
1054
1075
Most fields are consistent with plain format, with some exceptions:
1055
1076
1056
1077
- size is in bytes.
1057
-
- 'closest-backup-id' attribute contain ID of valid backup closest to the timeline, located on some of the previous timelines. This backup is the closest starting point to reach the timeline from other timelines by PITR. If such backup do not exists, then string is empty.
1078
+
- 'closest-backup-id' attribute contain ID of valid backup closest to the timeline, located on some of the previous timelines. This backup is the closest starting point to reach the timeline from other timelines by PITR. Closest backup always has a valid status, either OK or DONE. If such backup do not exists, then string is empty.
1058
1079
- DEGRADED timelines contain 'lost-segments' array with information about intervals of missing segments. In OK timelines 'lost-segments' array is empty.
1059
1080
- 'N backups' attribute is replaced with 'backups' array containing backups belonging to the timeline. If timeline has no backups, then 'backups' array is empty.
1060
1081
@@ -1214,7 +1235,8 @@ Deletes all backups and WAL files associated with the specified instance.
Adds the specified connection, compression, retention, logging and external directory settings into the pg_probackup.conf configuration file, or modifies the previously defined values.
1220
1242
@@ -1308,8 +1330,9 @@ 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.
1315
1338
@@ -1333,7 +1356,10 @@ Disables block-level checksum verification to speed up validation. During automa
1333
1356
--no-validate
1334
1357
Skips backup validation. You can use this flag if you validate backups regularly and would like to save time when running restore operations.
1335
1358
1336
-
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.
1359
+
--restore-command=cmdline
1360
+
Set the [restore_command](https://www.postgresql.org/docs/current/archive-recovery-settings.html#RESTORE-COMMAND) parameter to specified command. Example: `--restore-command='cp /mnt/server/archivedir/%f "%p"'`
1361
+
1362
+
Additionally [Recovery Target Options](#recovery-target-options), [Remote Mode Options](#remote-mode-options), [Remote WAL Archive Options](#remote-wal-archive-options), [Logging Options](#logging-options), [Partial Restore](#partial-restore) and [Common Options](#common-options) can be used.
1337
1363
1338
1364
For details on usage, see the section [Restoring a Cluster](#restoring-a-cluster).
1339
1365
@@ -1656,9 +1682,24 @@ Specifies pg_probackup installation directory on the remote system.
1656
1682
--ssh-options=ssh_options
1657
1683
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).
1658
1684
1685
+
#### Remote WAL Archive Options
1686
+
1687
+
This section describes the options used to provide the arguments for [Remote Mode Options](#remote-mode-options) in [archive-get](#archive-get) used in [restore_command](https://www.postgresql.org/docs/current/archive-recovery-settings.html#RESTORE-COMMAND) command when restoring ARCHIVE backup or performing PITR.
1688
+
1689
+
--archive-host=destination
1690
+
Provides the argument for `--remote-host` option in `archive-get` command.
1691
+
1692
+
--archive-port=port
1693
+
Default: 22
1694
+
Provides the argument for `--remote-port` option in `archive-get` command.
1695
+
1696
+
--archive-user=username
1697
+
Default: PostgreSQL user
1698
+
Provides the argument for `--remote-user` option in `archive-get` command. If you omit this option, the the user running PostgreSQL cluster is used.
1699
+
1659
1700
#### Partial Restore Options
1660
1701
1661
-
This section describes the options related to partial restore of cluster from backup. These options can be used with [restore](#restore) command.
1702
+
This section describes the options related to partial restore of a cluster from backup. These options can be used with [restore](#restore) command.
1662
1703
1663
1704
--db-exclude=dbname
1664
1705
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.
0 commit comments