barman recover with --target-time

33 views
Skip to first unread message

Tatyana

unread,
Jul 22, 2025, 9:54:28 AMJul 22
to Barman, Backup and Recovery Manager for PostgreSQL
Hello.
Can you help me with some issue/problem?
I have 3 (three) full backups for a specific server and I need to recover 
with an old one: today is 22 of Jul, and I need 18-th of Jul (06 am)
On the server with barman I have backups
Tue Jul 22 04:02:22 2025
Sun Jul 20 04:01:07 2025
Fri Jul 18 04:01:25 2025
So I've chosen Fri Jul 18 04:01:25 2025
the recovery string is:

barman recover --target-time "2025-07-18 06:35:35"  --target-action promote --remote-ssh-command "ssh postgres@ip_of_the_server"   server_name backup_id destination_dir

Doing PITR. Recovery target time: '2025-07-18 06:35:35+03:00'
Copying the base backup.
Copying required WAL segments.
But  it is copying all wal-files since 2025-07-18 till 2025-07-22
from the server with barman to the server where I do restoration,
I was expecting that only necessary wals would be  copied not all of them,
cause it demands a lot of disk space
May be I/m doing something wrong or it comes by design?

Some help would be appreciated!
WBR, Tatyana

Martin Marques

unread,
Jul 22, 2025, 11:01:44 AMJul 22
to pgba...@googlegroups.com
Hello Tatyana,

That is the way that Barman does a recovery with PITR and no-get-wal.
There isn't an easy way to know which WALs would be needed and which
ones won't, so we send all available WALs.

What you can do to overcome this issue is use the `--get-wal` option,
preferably with the `barman-cli` package installed on the remote node
(where postgres will be recovered). That way, barman will not copy any
WALs, and instead will add a `restore_command` line in the postgres
configuration so Postgres asks the Barman server for the WALs
on-demand.

Hope this clarifies the situation and gives you a solution.

Kind regards, Martín
> --
> --
> You received this message because you are subscribed to the "Barman for PostgreSQL" group.
> To post to this group, send email to pgba...@googlegroups.com
> To unsubscribe from this group, send email to
> pgbarman+u...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/pgbarman?hl=en?hl=en-GB
>
> ---
> You received this message because you are subscribed to the Google Groups "Barman, Backup and Recovery Manager for PostgreSQL" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to pgbarman+u...@googlegroups.com.
> To view this discussion, visit https://groups.google.com/d/msgid/pgbarman/bb31d907-7b31-47d8-8be1-17af2c28b200n%40googlegroups.com.
Message has been deleted
Message has been deleted

Tatyana

unread,
Jul 25, 2025, 10:58:29 AMJul 25
to Barman, Backup and Recovery Manager for PostgreSQL
Thank you so much for your advice.
It worked perfectly with `--get-wal` option and  `barman-cli` package installed.

WBR,  Tatyana

вторник, 22 июля 2025 г. в 18:01:44 UTC+3, Martin Marques:
Reply all
Reply to author
Forward
0 new messages