How it works...
As with our Barman installation process, we need to ensure that Barman can communicate directly with the PostgreSQL clone system. Once more, we rely on ssh-copy-id to transmit the necessary SSH key to the pg-clone server.
The next step is to erase any existing PostgreSQL files on the target server. This step should not be necessary on a new server, but it never hurts to double-check. Assuming that the postgres user has permission to write to /db directory, we are now ready to recover the backup to the pg-clone server.
At this point, we want to invoke the barman command with its recover operand. Remember, the default recovery system is the local server. As we're executing commands from pg-backup, that's not entirely useful ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access