BARMAN-RESTORE(1)
π¦ NAME π¦
barman-restore β Barman Sub-Commands
okay so this is the page for the barman-restore sub-command, and it lives in the Barman manual β you'll find it filed as BARMAN-RESTORE(1) in section 1. it's the one that puts your Postgres backups back. we love a comeback story π
β¨ SYNOPSIS β¨
restore
[ --aws-region AWS_REGION } ]
[ --azure-resource-group AZURE_RESOURCE_GRP ]
[ --bwlimit KBPS ]
[ --exclusive ]
[ --gcp-zone GCP_ZONE ]
[ { --get-wal | --no-get-wal } ]
[ { -h | --help } ]
[ { -j | --jobs } PARALLEL_WORKERS ]
[ --jobs-start-batch-period SECONDS ]
[ --jobs-start-batch-size NUMBER ]
[ --local-staging-path PATH ]
[ { --network-compression | --no-network-compression } ]
[ --no-retry ]
[ --partial-wal ]
[ --recovery-conf-filename FILENAME ]
[ --recovery-staging-path PATH ]
[ --staging-path STAGING_PATH ]
[ --staging-location STAGING_LOCATION ]
[ --combine-mode COMBINE_MODE ]
[ --remote-ssh-command STRING ]
[ --restore-command COMMAND ]
[ --retry-sleep SECONDS ]
[ --retry-times NUMBER ]
[ --snapshot-recovery-instance INSTANCE_NAME ]
[ --snapshot-recovery-zone GCP_ZONE ]
[ --skip-archive-wal ]
[ --standby-mode ]
[ --tablespace NAME:LOCATION [ --tablespace NAME:LOCATION ... ] ]
[ --target-action { pause | shutdown | promote } ]
[ --target-immediate ]
[ --target-lsn LSN ]
[ --target-name RESTORE_POINT_NAME ]
[ --target-time TIMESTAMP ]
[ --target-tli TLI ]
[ --target-xid XID ]
[ --staging-wal-directory ]
SERVER_NAME BACKUP_ID DESTINATION_DIR
(yes bestie, that lone } on the --aws-region line is exactly how it's written. we do not fix what we did not break π
)
π DESCRIPTION π
okay so what does this thing actually do? barman-restore runs a PostgreSQL server restore operation. Barman takes the backup from a server and drops it into your destination directory. simple as that. π
the restore can go down locally β right on the barman node itself β or remotely, on another machine you can reach over SSH. and what decides which one you get? literally one thing: whether or not you passed the --remote-ssh-command option. that's the whole vibe check. π
want the full lore? it's all in the Recovery section. and psst β you can use a shortcut instead of BACKUP_ID. π
πΈ PARAMETERS πΈ
the positional trio π«Ά
SERVER_NAMEβ the name of the server in the barman node.BACKUP_IDβ the id of the backup in the barman catalog. you can literally just writeautoand Barman will go find the most suitable backup for the restore operation all by itself. main character behavior, honestly. β¨DESTINATION_DIRβ the destination directory where the backup gets restored.
the options π§
--aws-regionβ specify the AWS region where the instance and disks for snapshot recovery are located. this option lets you override theaws_regionvalue in the Barman configuration.--azure-resource-groupβ specify the Azure resource group containing the instance and disks for snapshot recovery. this one lets you override theazure_resource_groupvalue in the Barman configuration.--bwlimitβ specify the maximum transfer rate in kilobytes per second. a value of0means no limit at all. this setting overrides thebandwidth_limitconfiguration option.--delta-restore/--no-delta-restoreβ enable/disable usage of delta-restore for a delta recovery. the default is based on therecovery_optionssetting.--exclusiveβ set the target (time, XID or LSN) to be non inclusive.--gcp-zoneβ specify the GCP zone where the instance and disks for snapshot recovery are located. this option lets you override thegcp_zonevalue in the Barman configuration.--get-wal/--no-get-walβ enable/disable usage ofget-walfor WAL fetching during recovery. the default is based on therecovery_optionssetting.
note: whenwals_directoryis configured to use cloud storage (like S3, Azure, GCS), restores always requireget-walfor WAL fetching. so if you specify--no-get-wal, or you just leaveget-walout ofrecovery_options, Barman will automatically enableget-walfor the restore operation and hit you with a warning. π not the plot twist you asked for but ok.
--partial-walβ copy.partialWAL files to the recovery destination with the.partialsuffix stripped. Barman looks at two sources here:.partialfiles in thestreaming_wals_directory(written bypg_receivewal) and.partialfiles in the main WAL archive (archived during standby promotion, possibly compressed or encrypted). this is only applicable when you're using--no-get-wal. when--get-walis used,.partialfiles are already handled transparently and this option has no effect. the flag also does nothing when--target-immediateis used, since recovery stops at the first consistent state before any partial WAL would even be needed. see Partial WAL files during recovery for the details. π-h,--helpβ show a help message and exit. gives you the info about command usage. the "bestie explain" button, basically.-j,--jobsPARALLEL_WORKERSβ specify the number of parallel workers to use for copying files during the backup. this setting overrides theparallel_jobsparameter if it's specified in the configuration file.--jobs-start-batch-periodβ specify the time period, in seconds, for starting a single batch of jobs. this value overrides theparallel_jobs_start_batch_periodparameter if it's set in the configuration file. the default is 1 second.--jobs-start-batch-sizeβ specify the maximum number of parallel workers to initiate in a single batch. this value overrides theparallel_jobs_start_batch_sizeparameter if it's defined in the configuration file. the default is 10 workers.--local-staging-pathβ specify a path on the Barman host where the chain of backups will be combined before being copied to the destination directory. whatever contents get created inside the staging path will be removed once the restore process completes. this option is necessary for restoring from block-level incremental backups and has no effect otherwise.
deprecated since version 3.15:--local-staging-pathis deprecated and will be removed in a future release. use--staging-pathand--staging-locationinstead. π
--network-compression/--no-network-compressionβ enable/disable network compression during remote restore. the default is based on thenetwork_compressionconfiguration setting.--no-retryβ there will be no retry in case of an error. it's the same as setting--retry-times 0. one shot, no takebacks π--recovery-conf-filenameβ specify the name of the file where Barman should write recovery options when recovering backups for Postgres versions 12 and later. by default this is set topostgresql.auto.conf. however, if--recovery-conf-filenameis specified, recovery options will be written to the specified value instead. while the default value is suitable for most Postgres installations, this option lets you specify an alternative location if Postgres is managed by tools that alter the configuration mechanism β for example, ifpostgresql.auto.confis symlinked to/dev/null. π--recovery-staging-pathβ specify a path on the recovery host where files for a compressed backup will be staged before being decompressed to the destination directory. backups get staged in their own directory within the staging path, following the naming conventionbarman-staging-SERVER_NAME-BACKUP_ID. this staging directory is removed after the restore process is complete. this option is mandatory for restoring from compressed backups and has no effect otherwise.
deprecated since version 3.15:--recovery-staging-pathis deprecated and will be removed in a future release. use--staging-pathand--staging-locationinstead. π
--staging-pathβ a path where intermediate files are staged during restore. when you're restoring a compressed backup, it serves as a temporary location for decompression before copying to the final destination. when you're restoring an incremental backup, it's where backups get combined before copying to the final destination. this location must have enough space to store the decompressed/combined backup. π«Ά--staging-locationβ specifies whether--staging-pathis a local or remote path. valid values arelocalandremote.--combine-modeβ specifies a copy mode forpg_combinebackupwhen combining incremental backups during a restore. the options include:copy(default): use standard file copying when combining incremental backups.link: use hard links when combining incremental backups. reconstruction of the synthetic backup might be faster (no file copying) and use less disk space.clone: use efficient file cloning (also known as "reflinks" on some systems) instead of copying files to the new data directory, which can result in near-instantaneous copying of the data files. β‘copy-file-range: use thecopy_file_rangesystem call for efficient copying. on some file systems this gives results similar toclone, sharing physical disk blocks, while on others it may still copy blocks, but do so via an optimized path.
refer to the pg_combinebackup documentation at https://www.postgresql.org/docs/current/app-pgcombinebackup.html for more details and restrictions of each mode. π
--remote-ssh-commandβ this option enables remote restore by specifying the secure shell command to execute on a remote host. it functions similarly to thessh_commandserver option in the configuration file for remote restore, that is,'ssh USER@SERVER'.--restore-commandβ specify a custom restore command to override Barman's defaultrestore_commandin the PostgreSQL recovery configuration. while the defaultrestore_commandbuilt by Barman is suitable for most cases, this option lets you specify an alternative command if your setup requires it. can be used only when running a restore with get-wal mode.--retry-sleepβ specify the number of seconds to wait after a failed copy before retrying. this setting applies to both backup and restore operations and overrides thebasebackup_retry_sleepparameter if it's defined in the configuration file.--retry-timesβ bestie, you get to say how many times Barman should retry the base backup copy if something goes π wrong. This hits both the backup and the restore operations, and it overrides thebasebackup_retry_timesparameter if that one's set in the config file. So if your config says one thing and your flag says another, the flag wins. Periodt.--snapshot-recovery-instanceβ drop the name of the instance where the disks recovered from the snapshots get attached. You need this one when you're recovering backups that were created withbackup_method=snapshot. No instance name, no recovery, iykyk.--snapshot-recovery-zoneβ (deprecated) the zone containing the instance and disks for the snapshot recovery. It's been replaced by--gcp-zone, so likeβ¦ she's retired, respect the legacy, use the new one. π--standby-modeβ do you want to start the Postgres server as a standby? Yes or no. That's it. That's the vibe check.--tablespaceβ specify a tablespace relocation rule.NAMEis the tablespace name, andLOCATIONis the recovery host destination path where you want that tablespace restored. Match made in heaven π--target-actionβ triggers a specific action the moment the recovery target is reached. Heads up: this option requires you to define a target along with one of these actions. The possible values are:pauseβ once the recovery target is hit, the server starts up in pause state, so you can go inspect the instance like the little detective you are πpromoteβ once the recovery target is hit, the server exits the recovery operation and gets promoted as a master. Main character promotion fr fr πshutdownβ once the recovery target is hit, the server just shuts down. Nap time. π΄
--target-immediateβ recovery is done as soon as a consistent state is reached, which is the end of the base backup. We love a clean finish β¨--target-lsnβ recover to the exact LSN (Log Sequence Number) you specify. This one requires Postgres 10 or above, so check your version first bestie.--target-nameβ recover to the specified name of a restore point that you previously created with thepg_create_restore_point(name)function. Named targets >>> everything.--target-timeβ recover to the specified time. Use the formatYYYY-MM-DD HH:MM:SS.mmm. Put it in exactly like that or it's giving chaos π--target-tliβ recover the specified timeline. Besides a numeric timeline ID, you can use the special valuescurrentandlatest. Here's the tea on defaults:- For Postgres versions 12 and above, the default is to recover to the latest timeline in the WAL archive.
- For Postgres versions below 12, the default is to recover to the timeline that was current at the time the backup was taken.
--target-xidβ recover to the specified transaction ID. Simple, clean, iconic.--skip-archive-walβ skip archiving staged WAL files before starting the restore. By default,barman restorearchives any WAL files in the server'sincoming/streaming directory before restoring, which helps reduce RPO in DR scenarios. Use this option when you want to skip that step entirely. Sometimes you just gotta move fast πββοΈ--staging-wal-directoryβ a staging directory on the destination host for WAL files when you're doing PITR. If you don't specify one, it uses abarman_waldirectory inside the destination directory. Default behaviour, cute behaviour πΈ
π SHORTCUTS π
Use shortcuts instead of BACKUP_ID. Yes, shortcuts. We're not typing a whole ID when a vibe word will do π
first/oldestβ the oldest available backup for the server, in chronological order.last/latestβ the most recent available backup for the server, in chronological order.last-full/latest-fullβ the most recent full backup taken with methodsrsyncorpostgres.last-failedβ the most recent backup that failed, in chronological order. π (we don't talk about her)
π Author π
EnterpriseDB
π Copyright π
Β© Copyright EnterpriseDB UK Limited 2011-2026
okay bestie that's the whole page, you ate it π«Ά this was Barman 3.20, dated Sep 29, 2026, and it lives in section BARMAN-RESTORE(1). go restore something iconic, no cap π
β¨
π¦ where this page comes from
- epel 10: barman 3.20.1-1.el10_3 Β· GPL-3.0-only
- fedora 43: barman 3.20.1-1.fc43 Β· GPL-3.0-only
- fedora 43: barman 3.20.1-3.fc43 Β· GPL-3.0-only
- fedora 44: barman 3.20.1-1.fc44 Β· GPL-3.0-only
- fedora 44: barman 3.20.1-3.fc44 Β· GPL-3.0-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms