Using barman-cloud-restore from a hook backup

18 views
Skip to first unread message

Duster

unread,
Jun 2, 2025, 2:13:23 PMJun 2
to Barman, Backup and Recovery Manager for PostgreSQL
Here is my setup:

Postgres Server = pg16
Barman Server = barman
pre_archive_retry_script = 'barman-cloud-wal-archive -v --cloud-provider aws-s3 ...'
post_backup_retry_script = 'barman-cloud-backup -v --cloud-provider aws-s3 ...'

I performed a backup of pg16 the BACKUP ID is 20250602T163025,  I am simulating that AWS has the backup but the barman server no longer has the backup which I need to restore.  I tried running the following command from the barman server:

barman-cloud-restore -v --cloud-provider aws-s3 s3://bucket pg16 20250602T163025 $PGDATA

This command did not work as I expected as the PGDATA directory for pg16 does not exist on the barman server, I was guessing that it would restore to the pg16 server.

So, I then tried from the pg16 server the same command. This resulted in receiving an error that the barman user does not exist.  This makes sese to me, since I am using the central barman server approach. In addition the pg16 server does not have access to AWS S3 ONLY the barman server does.

My question is what is the proper way to perform this recovery?  The documentation is not clear on the steps to recover a backup from the cloud that was done using hook scripts.

Marcelius Atanga

unread,
Oct 27, 2025, 5:36:19 AM (9 days ago) Oct 27
to Barman, Backup and Recovery Manager for PostgreSQL
Dear Barman Community,
I hope you're all doing well.
I'm reaching out to ask for guidance regarding an issue I'm facing with backing up a large PostgreSQL instance (over 10TB) to AWS S3 using Barman. Despite following the documented steps and using  with the appropriate parameters, the backup does not complete successfully — and no data appears in the S3 bucket.
Here’s a brief overview of my setup:
PostgreSQL version:13
Barman server:pg-db03
Cloud provider: AWS S3
Backup command used:

barman-cloud-backup \
  --cloud-provider aws-s3 \
  --endpoint-url https://s3.amazonaws.com \
  --aws-profile default \
  s3://pxxxxxxxital-paprod-backups/database-data/barman \
 pg-db01

The backup appears to run without error, but no data is uploaded to S3. I’ve confirmed that a completed backup exists locally and that the AWS credentials have the necessary permissions. I’ve also tried running the command with , but it didn’t reveal any obvious issues.
I would greatly appreciate any advice or suggestions from the group — especially from those who’ve worked with large-scale backups or cloud archiving setups. If there are best practices or alternative approaches for handling backups of this size, I’d love to hear them.
Thank you in advance for your time and support.
Best regards,
Reply all
Reply to author
Forward
0 new messages