remote recovery

1,762 views
Skip to first unread message

Milos Gajdos

unread,
Mar 21, 2013, 8:38:16 AM3/21/13
to pgba...@googlegroups.com
Can someone give me an example how to restore backup to remote server ?
I'm totally confused by the documentation...
It says:

Barman is able to recover a backup on a remote server through the --remote-ssh-command COMMAND option for the recovercommand.

But what is that command ? is that a command for starting Postgres remotely after barman rsync's backup over ?
Can someone shed a bit more light on this please ?

Thanks 
M.

Anderson Lunz

unread,
Mar 21, 2013, 10:08:50 AM3/21/13
to pgba...@googlegroups.com
   Hi!

   This one worked for me:

barman recover --remote-ssh-command "<ssh command>" <server name> <backup id> <remote data directory>

Example:
barman recover --remote-ssh-command "ssh postgres@ca-mtl2-devdb-2" ubi-integration-qa 20130226T100719 /var/lib/pgsql/9.1/data

    And them I started the recovered db directly on the remote host, but I think that you can issue a command like this from barman's server:

ssh postgres@ca-mtl2-devdb-2 /usr/pgsql-9.1/bin/pg_ctl -D /var/lib/pgsql/9.1/data start

Milos Gajdos

unread,
Mar 21, 2013, 11:28:11 AM3/21/13
to pgba...@googlegroups.com
Great stuff!
Thanks!

Konstantin Tokar

unread,
Mar 24, 2015, 7:53:13 PM3/24/15
to pgba...@googlegroups.com
Hi!

I often
need to update the database from scratch.
I use barman recover --remote-ssh-command "ssh postgres @ db" ...
Is there no way of launching the remote restore via rsync - not to transfer existing files on the server, and send only the changed part?

Something like a barman recover --remote-ssh-command "rsync postgres @ db" ...

--
Konstantin Tokar

Marco Nenciarini

unread,
Mar 25, 2015, 4:36:32 AM3/25/15
to pgba...@googlegroups.com
Hi Konstantin,

Il 25/03/15 00:53, Konstantin Tokar ha scritto:
> Hi!
>
> I often need to update the database from scratch.
> I use */barman recover --remote-ssh-command "ssh postgres @ db" .../*
> Is there no way of launching the remote restore via rsync - not to transfer existing files on the server, and send only the changed part?

What you are searching for is the barman default mode of operation. The remote-ssh-command argument is used to connect to the remote host, then rsync is used to restore the content of data directory. Only WALs file are always transferred, so to speed up the recovery it's better to start it just after a backup.

Regards,
Marco

--
Marco Nenciarini - 2ndQuadrant Italy
PostgreSQL Training, Services and Support
marco.ne...@2ndQuadrant.it | www.2ndQuadrant.it

signature.asc
Reply all
Reply to author
Forward
0 new messages