3.5. Remote Restore #

Remote restore in pg_probackup3 is a functionality that allows restoring backups directly to a remote host without the need to manually copy archive files. This approach significantly reduces recovery time and minimizes manual operations during disaster recovery, migration, or automated deployment. It is particularly useful in infrastructures with centralized backup storage where recovery is performed onto isolated remote servers.

The remote restore functionality consists of the following main components:

  • The send-backup command in the pg_probackup3 utility to send data to a remote server through a specified port using multithreading.

  • The pgpro_backupstream utility, manually started on the remote server, to receive, extract, and restore the data.

The following conditions must be met to perform remote restore:

  • On the local system:

    • The pg_probackup3 utility and the libpgprobackup library must be installed.

    • The backup catalog must be accessible.

  • On the remote system:

    • The pgpro_backupstream utility must be installed.

      Note

      pgpro_backupstream requires manual startup.

    • The PGDATA directory must be empty and writable.

      Note

      The incremental restore mode is not currently supported.

    • The specified port must be open and available for incoming connections.

To restore an instance to a remote host, perform the following steps:

  1. On the local system's side, run the send-backup command via the pg_probackup3 utility to send the backup data to the remote host over the specified port:

    pg_probackup3 send-backup -B backup_dir --instance=instance_name -i backup_id -p port -h host [--no-merge]
    

    Using the --no-merge flag will prevent the backup chain from being merged before the data transfer. Otherwise, the backup chain will be merged into a temporary file, which will be deleted after the transfer is complete.

  2. On the remote system's side, run the restore command via the pgpro_backupstream utility to receive the backup data and perform restore:

    pgpro_backupstream restore -D path_to_restore [-p port]
    

    If the port is not specified, STDIN is used.

Important

Run the pgpro_backupstream utility on the remote system before initiating the data transfer with the send-backup command.