Export Barman Backups

1,368 views
Skip to first unread message

Mateus Ventura

unread,
Oct 21, 2014, 11:59:41 AM10/21/14
to pgba...@googlegroups.com
Hello,

I would like to know if it's possible to export backups generated by barman.
I'm setting up a new environment using PostgreSQL, and i want to use barman as my backup solution, but i don't know how can i export barman backup's to a tape drive, amazon S3 or something like that.

And if it's not possible, can you guys show me some tips to workaround this problem?

Sorry for my bad english :(

Thank You

Mateus Ventura

Gabriele Bartolini

unread,
Oct 22, 2014, 8:59:17 AM10/22/14
to pgba...@googlegroups.com
Hi Mateus,

  It is possibile indirectly through the list-files command and TAR integration. Type:

barman help list-files

Cheers
Gabriele

Inviato da iPad
--
--
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.
For more options, visit https://groups.google.com/d/optout.

Mateus Ventura

unread,
Oct 22, 2014, 11:51:45 AM10/22/14
to pgba...@googlegroups.com
Hi Gabriele,

Thanks for your answer, it worked.

What i had to do for it to work:

1- barman list-files server_name backup_id --target full |tar cfz foo.tgz -T - 

I set the --target parameter to full (don't if it's necessary) and as instructed by Gabriele, i piped it to tar, using the -T parameter to pass a list of files, and the - to tell it to get the list of files from stdin.

To restore the backup
i extracted it
created the recovery.conf file on the extracted folder  
set the restore_command parameter to 'rsync -a /path/to/wals/%f %p'

When i tried to start the cluster, it complained that there were missing some folders.
I checked the original cluster, and the missing folders were empty, i guess barman does not copy empty folders during the backup procedure.
So i created them, started the cluest with pg_ctl -D /path/to/pgdata/ start .
And then it worked fine.

Thanks for your help

Sorry for my bad english :(

Mateus Ventura

Leo Ferlin Sutton

unread,
Nov 19, 2015, 12:02:32 PM11/19/15
to Barman, Backup and Recovery Manager for PostgreSQL
This :

When i tried to start the cluster, it complained that there were missing some folders.
I checked the original cluster, and the missing folders were empty, i guess barman does not copy empty folders during the backup procedure.
So i created them, started the cluest with pg_ctl -D /path/to/pgdata/ start .

Seems pretty important to me. I tried to basically export/import from barman. It almost worked fine except the list-files "forgot" to add the empty (but essential) folders. Instead I just compressed base/SAVEID/ and added the list-files --target wal to the archive and it went file. I re-imported by copying back the save and the wal and using rebuild_xlogdb.

Iñigo Quintana

unread,
Dec 16, 2015, 3:15:59 AM12/16/15
to Barman, Backup and Recovery Manager for PostgreSQL
Hello,

In this thread https://groups.google.com/forum/#!topic/pgbarman/Loib6IatXsk I have documented some shell scripts to copy barman catalog into S3 +  copy it back into new AWS instance  after an instance disaster + perform a barman recover.

Best regards
Reply all
Reply to author
Forward
0 new messages