3.10. Cloning and Synchronizing a Postgres Pro Instance #

pg_probackup3 can create a copy of a Postgres Pro instance directly, without using the backup catalog. To do this, you can run the catchup command. It can be useful in the following cases:

catchup specifications and limitations:

To prepare for cloning/synchronizing a Postgres Pro instance, set up the source server as follows:

Before cloning/synchronizing a Postgres Pro instance, ensure that the source server is running and accepting connections. To clone/synchronize a Postgres Pro instance, on the server with the destination instance, run the catchup command as follows:

pg_probackup3 catchup -b catchup_mode --destination-pgdata=path_to_local_dir --stream [connection_options]

Where catchup_mode can take one of the following values:

By specifying the --stream option, you can set the STREAM WAL delivery mode of copying, which will include all the necessary WAL files by streaming them from the server via replication protocol.

You can use connection_options to specify the connection to the source database cluster.

If the source database cluster contains tablespaces that must be located in a different directory, additionally specify the --tablespace-mapping option:

pg_probackup3 catchup -b catchup_mode --destination-pgdata=path_to_local_dir --stream --tablespace-mapping=OLDDIR=NEWDIR

To run the catchup command on parallel threads, specify the number of threads with the --threads or --num-write-threads and --num-validate-threads options:

pg_probackup3 catchup -b catchup_mode --destination-pgdata=path_to_local_dir --stream --threads=num_threads