| 1 |
'\" t |
| 2 |
.\" Man page generated from reStructuredText |
| 3 |
.\" by the Docutils 0.22.4 manpage writer. |
| 4 |
. |
| 5 |
. |
| 6 |
.nr rst2man-indent-level 0 |
| 7 |
. |
| 8 |
.de1 rstReportMargin |
| 9 |
\\$1 \\n[an-margin] |
| 10 |
level \\n[rst2man-indent-level] |
| 11 |
level margin: \\n[rst2man-indent\\n[rst2man-indent-level]] |
| 12 |
- |
| 13 |
\\n[rst2man-indent0] |
| 14 |
\\n[rst2man-indent1] |
| 15 |
\\n[rst2man-indent2] |
| 16 |
.. |
| 17 |
.de1 INDENT |
| 18 |
.\" .rstReportMargin pre: |
| 19 |
. RS \\$1 |
| 20 |
. nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin] |
| 21 |
. nr rst2man-indent-level +1 |
| 22 |
.\" .rstReportMargin post: |
| 23 |
.. |
| 24 |
.de UNINDENT |
| 25 |
. RE |
| 26 |
.\" indent \\n[an-margin] |
| 27 |
.\" old: \\n[rst2man-indent\\n[rst2man-indent-level]] |
| 28 |
.nr rst2man-indent-level -1 |
| 29 |
.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]] |
| 30 |
.in \\n[rst2man-indent\\n[rst2man-indent-level]]u |
| 31 |
.. |
| 32 |
.TH "BARMAN-RESTORE" "1" "Sep 29, 2026" "3.20" "Barman" |
| 33 |
.SH NAME |
| 34 |
barman-restore \- Barman Sub-Commands |
| 35 |
.SH SYNOPSIS |
| 36 |
.INDENT 0.0 |
| 37 |
.INDENT 3.5 |
| 38 |
.sp |
| 39 |
.EX |
| 40 |
restore |
| 41 |
[ \-\-aws\-region AWS_REGION } ] |
| 42 |
[ \-\-azure\-resource\-group AZURE_RESOURCE_GRP ] |
| 43 |
[ \-\-bwlimit KBPS ] |
| 44 |
[ \-\-exclusive ] |
| 45 |
[ \-\-gcp\-zone GCP_ZONE ] |
| 46 |
[ { \-\-get\-wal | \-\-no\-get\-wal } ] |
| 47 |
[ { \-h | \-\-help } ] |
| 48 |
[ { \-j | \-\-jobs } PARALLEL_WORKERS ] |
| 49 |
[ \-\-jobs\-start\-batch\-period SECONDS ] |
| 50 |
[ \-\-jobs\-start\-batch\-size NUMBER ] |
| 51 |
[ \-\-local\-staging\-path PATH ] |
| 52 |
[ { \-\-network\-compression | \-\-no\-network\-compression } ] |
| 53 |
[ \-\-no\-retry ] |
| 54 |
[ \-\-partial\-wal ] |
| 55 |
[ \-\-recovery\-conf\-filename FILENAME ] |
| 56 |
[ \-\-recovery\-staging\-path PATH ] |
| 57 |
[ \-\-staging\-path STAGING_PATH ] |
| 58 |
[ \-\-staging\-location STAGING_LOCATION ] |
| 59 |
[ \-\-combine\-mode COMBINE_MODE ] |
| 60 |
[ \-\-remote\-ssh\-command STRING ] |
| 61 |
[ \-\-restore\-command COMMAND ] |
| 62 |
[ \-\-retry\-sleep SECONDS ] |
| 63 |
[ \-\-retry\-times NUMBER ] |
| 64 |
[ \-\-snapshot\-recovery\-instance INSTANCE_NAME ] |
| 65 |
[ \-\-snapshot\-recovery\-zone GCP_ZONE ] |
| 66 |
[ \-\-skip\-archive\-wal ] |
| 67 |
[ \-\-standby\-mode ] |
| 68 |
[ \-\-tablespace NAME:LOCATION [ \-\-tablespace NAME:LOCATION ... ] ] |
| 69 |
[ \-\-target\-action { pause | shutdown | promote } ] |
| 70 |
[ \-\-target\-immediate ] |
| 71 |
[ \-\-target\-lsn LSN ] |
| 72 |
[ \-\-target\-name RESTORE_POINT_NAME ] |
| 73 |
[ \-\-target\-time TIMESTAMP ] |
| 74 |
[ \-\-target\-tli TLI ] |
| 75 |
[ \-\-target\-xid XID ] |
| 76 |
[ \-\-staging\-wal\-directory ] |
| 77 |
SERVER_NAME BACKUP_ID DESTINATION_DIR |
| 78 |
.EE |
| 79 |
.UNINDENT |
| 80 |
.UNINDENT |
| 81 |
.SH DESCRIPTION |
| 82 |
.sp |
| 83 |
Execute a PostreSQL server restore operation. Barman will restore the backup from a |
| 84 |
server in the destination directory. The restoration can be performed locally (on the |
| 85 |
barman node itself) or remotely (on another machine accessible via SSH). The location is |
| 86 |
determined by whether or not the \fB\-\-remote\-ssh\-command\fP option is used. More |
| 87 |
information on this command can be found in the Recovery \%<#\:recovery> section. You can use a |
| 88 |
shortcut instead of \fBBACKUP_ID\fP\&. |
| 89 |
.SH PARAMETERS |
| 90 |
.INDENT 0.0 |
| 91 |
.TP |
| 92 |
.B \fBSERVER_NAME\fP |
| 93 |
Name of the server in barman node |
| 94 |
.TP |
| 95 |
.B \fBBACKUP_ID\fP |
| 96 |
Id of the backup in the barman catalog. Use \fBauto\fP to have Barman automatically |
| 97 |
find the most suitable backup for the restore operation. |
| 98 |
.TP |
| 99 |
.B \fBDESTINATION_DIR\fP |
| 100 |
Destination directory to restore the backup. |
| 101 |
.TP |
| 102 |
.B \fB\-\-aws\-region\fP |
| 103 |
Specify the AWS region where the instance and disks for snapshot recovery are |
| 104 |
located. This option allows you to override the \fBaws_region\fP value in the Barman |
| 105 |
configuration. |
| 106 |
.TP |
| 107 |
.B \fB\-\-azure\-resource\-group\fP |
| 108 |
Specify the Azure resource group containing the instance and disks for snapshot |
| 109 |
recovery. This option allows you to override the \fBazure_resource_group\fP value in |
| 110 |
the Barman configuration. |
| 111 |
.TP |
| 112 |
.B \fB\-\-bwlimit\fP |
| 113 |
Specify the maximum transfer rate in kilobytes per second. A value of \fB0\fP |
| 114 |
indicates no limit. This setting overrides the \fBbandwidth_limit\fP configuration |
| 115 |
option. |
| 116 |
.TP |
| 117 |
.B \fB\-\-delta\-restore\fP / \fB\-\-no\-delta\-restore\fP |
| 118 |
Enable/disable usage of \fBdelta\-restore\fP for a delta recovery. Default is based on |
| 119 |
\fBrecovery_options\fP setting. |
| 120 |
.TP |
| 121 |
.B \fB\-\-exclusive\fP |
| 122 |
Set target (time, XID or LSN) to be non inclusive. |
| 123 |
.TP |
| 124 |
.B \fB\-\-gcp\-zone\fP |
| 125 |
Specify the GCP zone where the instance and disks for snapshot recovery are located. |
| 126 |
This option allows you to override the \fBgcp_zone\fP value in the Barman |
| 127 |
configuration. |
| 128 |
.TP |
| 129 |
.B \fB\-\-get\-wal\fP / \fB\-\-no\-get\-wal\fP |
| 130 |
Enable/disable usage of \fBget\-wal\fP for WAL fetching during recovery. Default is based on |
| 131 |
\fBrecovery_options\fP setting. |
| 132 |
.sp |
| 133 |
\fBNote:\fP |
| 134 |
.INDENT 7.0 |
| 135 |
.INDENT 3.5 |
| 136 |
When \fBwals_directory\fP is configured to use cloud storage (e.g. S3, Azure, |
| 137 |
GCS), restores always require \fBget\-wal\fP for WAL fetching. If you specify |
| 138 |
\fB\-\-no\-get\-wal\fP or omit \fBget\-wal\fP from \fBrecovery_options\fP, Barman will |
| 139 |
automatically enable \fBget\-wal\fP for the restore operation and issue a |
| 140 |
warning. |
| 141 |
.UNINDENT |
| 142 |
.UNINDENT |
| 143 |
.TP |
| 144 |
.B \fB\-\-partial\-wal\fP |
| 145 |
Copy \fB\&.partial\fP WAL files to the recovery destination with the \fB\&.partial\fP |
| 146 |
suffix stripped. Barman considers two sources: \fB\&.partial\fP files in the |
| 147 |
\fBstreaming_wals_directory\fP (written by \fBpg_receivewal\fP) and \fB\&.partial\fP |
| 148 |
files in the main WAL archive (archived during standby promotion, possibly |
| 149 |
compressed or encrypted). Only applicable when using \fB\-\-no\-get\-wal\fP\&. When |
| 150 |
\fB\-\-get\-wal\fP is used, \fB\&.partial\fP files are already handled transparently and |
| 151 |
this option has no effect. The flag also has no effect when \fB\-\-target\-immediate\fP |
| 152 |
is used, since recovery stops at the first consistent state before any partial WAL |
| 153 |
would be needed. See Partial WAL files during recovery \%<#\:recovery-partial-wal-files> for details. |
| 154 |
.TP |
| 155 |
.B \fB\-h\fP / \fB\-\-help\fP |
| 156 |
Show a help message and exit. Provides information about command usage. |
| 157 |
.TP |
| 158 |
.B \fB\-j\fP / \fB\-\-jobs\fP |
| 159 |
Specify the number of parallel workers to use for copying files during the backup. |
| 160 |
This setting overrides the \fBparallel_jobs\fP parameter if it is specified in the |
| 161 |
configuration file. |
| 162 |
.TP |
| 163 |
.B \fB\-\-jobs\-start\-batch\-period\fP |
| 164 |
Specify the time period, in seconds, for starting a single batch of jobs. This value |
| 165 |
overrides the \fBparallel_jobs_start_batch_period\fP parameter if it is set in the |
| 166 |
configuration file. The default is \fB1\fP second. |
| 167 |
.TP |
| 168 |
.B \fB\-\-jobs\-start\-batch\-size\fP |
| 169 |
Specify the maximum number of parallel workers to initiate in a single batch. This |
| 170 |
value overrides the \fBparallel_jobs_start_batch_size\fP parameter if it is defined in |
| 171 |
the configuration file. The default is \fB10\fP workers. |
| 172 |
.TP |
| 173 |
.B \fB\-\-local\-staging\-path\fP |
| 174 |
Specify path on the Barman host where the chain of backups will be combined before |
| 175 |
being copied to the destination directory. The contents created within the staging |
| 176 |
path will be removed upon completion of the restore process. This option is |
| 177 |
necessary for restoring from block\-level incremental backups and has no effect |
| 178 |
otherwise. |
| 179 |
.sp |
| 180 |
Deprecated since version 3.15: \fB\-\-local\-staging\-path\fP is deprecated and will be removed in a future release. |
| 181 |
Use \fB\-\-staging\-path\fP and \fB\-\-staging\-location\fP instead. |
| 182 |
|
| 183 |
.TP |
| 184 |
.B \fB\-\-network\-compression\fP / \fB\-\-no\-network\-compression\fP |
| 185 |
Enable/disable network compression during remote restore. Default is based on |
| 186 |
\fBnetwork_compression\fP configuration setting. |
| 187 |
.TP |
| 188 |
.B \fB\-\-no\-retry\fP |
| 189 |
There will be no retry in case of an error. It is the same as setting |
| 190 |
\fB\-\-retry\-times 0\fP\&. |
| 191 |
.TP |
| 192 |
.B \fB\-\-recovery\-conf\-filename\fP |
| 193 |
Specify the name of the file where Barman should write recovery options when |
| 194 |
recovering backups for Postgres versions 12 and later. By default, this is set to |
| 195 |
\fBpostgresql.auto.conf\fP\&. However, if \fB\-\-recovery\-conf\-filename\fP is specified, |
| 196 |
recovery options will be written to the specified value instead. While the default |
| 197 |
value is suitable for most Postgres installations, this option allows you to specify |
| 198 |
an alternative location if Postgres is managed by tools that alter the configuration |
| 199 |
mechanism (for example, if \fBpostgresql.auto.conf\fP is symlinked to \fB/dev/null\fP). |
| 200 |
.TP |
| 201 |
.B \fB\-\-recovery\-staging\-path\fP |
| 202 |
Specify a path on the recovery host where files for a compressed backup will be |
| 203 |
staged before being decompressed to the destination directory. Backups will be |
| 204 |
staged in their own directory within the staging path, following the naming |
| 205 |
convention: \fBbarman\-staging\-SERVER_NAME\-BACKUP_ID\fP\&. This staging directory will be |
| 206 |
removed after the restore process is complete. This option is mandatory for |
| 207 |
restoring from compressed backups and has no effect otherwise. |
| 208 |
.sp |
| 209 |
Deprecated since version 3.15: \fB\-\-recovery\-staging\-path\fP is deprecated and will be removed in a future release. |
| 210 |
Use \fB\-\-staging\-path\fP and \fB\-\-staging\-location\fP instead. |
| 211 |
|
| 212 |
.TP |
| 213 |
.B \fB\-\-staging\-path\fP |
| 214 |
A path where intermediate files are staged during restore. When restoring a |
| 215 |
compressed backup, it serves as a temporary location for decompression before |
| 216 |
copying to the final destination. When restoring an incremental backup, it is where |
| 217 |
backups are combined before copying to the final destination. This location must |
| 218 |
have enough space to store the decompressed/combined backup. |
| 219 |
.TP |
| 220 |
.B \fB\-\-staging\-location\fP |
| 221 |
Specifies whether \fB\-\-staging\-path\fP is a local or remote path. Valid values are |
| 222 |
\fBlocal\fP and \fBremote\fP\&. |
| 223 |
.TP |
| 224 |
.B \fB\-\-combine\-mode\fP |
| 225 |
Specifies a copy mode for \fBpg_combinebackup\fP when combining incremental backups |
| 226 |
during a restore. |
| 227 |
.sp |
| 228 |
Options include: |
| 229 |
.INDENT 7.0 |
| 230 |
.IP \(bu 2 |
| 231 |
\fBcopy\fP (default): Use standard file copying when combining incremental backups. |
| 232 |
.IP \(bu 2 |
| 233 |
\fBlink\fP: Use hard links when combining incremental backups. Reconstruction of the |
| 234 |
synthetic backup might be faster (no file copying) and use less disk space. |
| 235 |
.IP \(bu 2 |
| 236 |
\fBclone\fP: Use efficient file cloning (also known as “reflinks” on some systems) |
| 237 |
instead of copying files to the new data directory, which can result in |
| 238 |
near\-instantaneous copying of the data files. |
| 239 |
.IP \(bu 2 |
| 240 |
\fBcopy\-file\-range\fP: Use the \fBcopy_file_range\fP system call for efficient copying. |
| 241 |
On some file systems this gives results similar to \fBclone\fP, sharing physical disk |
| 242 |
blocks, while on others it may still copy blocks, but do so via an optimized path. |
| 243 |
.UNINDENT |
| 244 |
.sp |
| 245 |
Refer to the pg_combinebackup documentation \%<https://\:www\:.postgresql\:.org/\:docs/\:current/\:app-pgcombinebackup\:.html> |
| 246 |
for more details and restrictions of each mode. |
| 247 |
.TP |
| 248 |
.B \fB\-\-remote\-ssh\-command\fP |
| 249 |
This option enables remote restore by specifying the secure shell command to |
| 250 |
execute on a remote host. It functions similarly to the \fBssh_command\fP server |
| 251 |
option in the configuration file for remote restore, that is, \fB\(aqssh USER@SERVER\(aq\fP\&. |
| 252 |
.TP |
| 253 |
.B \fB\-\-restore\-command\fP |
| 254 |
Specify a custom restore command to override Barman\(aqs default restore_command in |
| 255 |
the PostgreSQL recovery configuration. While the default restore_command built by |
| 256 |
Barman is suitable for most cases, this option allows you to specify an alternative |
| 257 |
command if your setup requires it. Can be used only when running a restore with |
| 258 |
\fBget\-wal\fP mode. |
| 259 |
.TP |
| 260 |
.B \fB\-\-retry\-sleep\fP |
| 261 |
Specify the number of seconds to wait after a failed copy before retrying. This |
| 262 |
setting applies to both backup and restore operations and overrides the |
| 263 |
\fBbasebackup_retry_sleep\fP parameter if it is defined in the configuration file. |
| 264 |
.TP |
| 265 |
.B \fB\-\-retry\-times\fP |
| 266 |
Specify the number of times to retry the base backup copy in case of an error. This |
| 267 |
applies to both backup and restore operations and overrides the |
| 268 |
\fBbasebackup_retry_times\fP parameter if it is set in the configuration file. |
| 269 |
.TP |
| 270 |
.B \fB\-\-snapshot\-recovery\-instance\fP |
| 271 |
Specify the name of the instance where the disks recovered from the snapshots are |
| 272 |
attached. This option is necessary when recovering backups created with |
| 273 |
\fBbackup_method=snapshot\fP\&. |
| 274 |
.TP |
| 275 |
.B \fB\-\-snapshot\-recovery\-zone\fP (deprecated) |
| 276 |
Zone containing the instance and disks for the snapshot recovery (deprecated: |
| 277 |
replaced by \fB\-\-gcp\-zone\fP) |
| 278 |
.TP |
| 279 |
.B \fB\-\-standby\-mode\fP |
| 280 |
Whether to start the Postgres server as a standby. |
| 281 |
.TP |
| 282 |
.B \fB\-\-tablespace\fP |
| 283 |
Specify tablespace relocation rule. \fBNAME\fP is the tablespace name and \fBLOCATION\fP |
| 284 |
is the recovery host destination path to restore the tablespace. |
| 285 |
.TP |
| 286 |
.B \fB\-\-target\-action\fP |
| 287 |
Trigger the specified action when the recovery target is reached. This option |
| 288 |
requires defining a target along with one of these actions. The possible values are: |
| 289 |
.INDENT 7.0 |
| 290 |
.IP \(bu 2 |
| 291 |
\fBpause\fP: Once recovery target is reached, the server is started in pause state, |
| 292 |
allowing users to inspect the instance |
| 293 |
.IP \(bu 2 |
| 294 |
\fBpromote\fP: Once recovery target is reached, the server will exit the recovery |
| 295 |
operation and is promoted as a master. |
| 296 |
.IP \(bu 2 |
| 297 |
\fBshutdown\fP: Once recovery target is reached, the server is shut down. |
| 298 |
.UNINDENT |
| 299 |
.TP |
| 300 |
.B \fB\-\-target\-immediate\fP |
| 301 |
Recovery is completed when a consistent state is reached (end of the base backup). |
| 302 |
.TP |
| 303 |
.B \fB\-\-target\-lsn\fP |
| 304 |
Recover to the specified LSN (Log Sequence Number). Requires Postgres 10 or above. |
| 305 |
.TP |
| 306 |
.B \fB\-\-target\-name\fP |
| 307 |
Recover to the specified name of a restore point previously created with the |
| 308 |
\fBpg_create_restore_point(name)\fP\&. |
| 309 |
.TP |
| 310 |
.B \fB\-\-target\-time\fP |
| 311 |
Recover to the specified time. Use the format \fBYYYY\-MM\-DD HH:MM:SS.mmm\fP\&. |
| 312 |
.TP |
| 313 |
.B \fB\-\-target\-tli\fP |
| 314 |
Recover the specified timeline. You can use the special values \fBcurrent\fP and |
| 315 |
\fBlatest\fP in addition to a numeric timeline ID. For Postgres versions 12 and above, |
| 316 |
the default is to recover to the latest timeline in the WAL archive. For Postgres |
| 317 |
versions below 12, the default is to recover to the timeline that was current at the |
| 318 |
time the backup was taken. |
| 319 |
.TP |
| 320 |
.B \fB\-\-target\-xid\fP |
| 321 |
Recover to the specified transaction ID. |
| 322 |
.UNINDENT |
| 323 |
.INDENT 0.0 |
| 324 |
.TP |
| 325 |
.B \fB\-\-skip\-archive\-wal\fP |
| 326 |
Skip archiving staged WAL files before starting the restore. By default, \fBbarman |
| 327 |
restore\fP archives any WAL files in the server\(aqs \fBincoming\fP/ \fBstreaming\fP |
| 328 |
directory before restoring to reduce RPO in DR scenarios. Use this option when you |
| 329 |
want to skip this step. |
| 330 |
.TP |
| 331 |
.B \fB\-\-staging\-wal\-directory\fP |
| 332 |
A staging directory on the destination host for WAL files when performing PITR. If |
| 333 |
unspecified, it uses a \fBbarman_wal\fP directory inside the destination directory. |
| 334 |
.UNINDENT |
| 335 |
.SH SHORTCUTS |
| 336 |
.sp |
| 337 |
Use shortcuts instead of \fBBACKUP_ID\fP\&. |
| 338 |
.TS |
| 339 |
box center; |
| 340 |
l|l. |
| 341 |
T{ |
| 342 |
\fBShortcut\fP |
| 343 |
T} T{ |
| 344 |
\fBDescription\fP |
| 345 |
T} |
| 346 |
_ |
| 347 |
T{ |
| 348 |
\fBfirst/oldest\fP |
| 349 |
T} T{ |
| 350 |
Oldest available backup for the server, in chronological order. |
| 351 |
T} |
| 352 |
_ |
| 353 |
T{ |
| 354 |
\fBlast/latest\fP |
| 355 |
T} T{ |
| 356 |
Most recent available backup for the server, in chronological order. |
| 357 |
T} |
| 358 |
_ |
| 359 |
T{ |
| 360 |
\fBlast\-full/latest\-full\fP |
| 361 |
T} T{ |
| 362 |
Most recent full backup taken with methods \fBrsync\fP or \fBpostgres\fP\&. |
| 363 |
T} |
| 364 |
_ |
| 365 |
T{ |
| 366 |
\fBlast\-failed\fP |
| 367 |
T} T{ |
| 368 |
Most recent backup that failed, in chronological order. |
| 369 |
T} |
| 370 |
.TE |
| 371 |
.SH Author |
| 372 |
EnterpriseDB |
| 373 |
.SH Copyright |
| 374 |
© Copyright EnterpriseDB UK Limited 2011-2026 |
| 375 |
.\" End of generated man page. |