Chapter 1. About pg_probackup3

pg_probackup3 is designed to manage backup and recovery of PostgreSQL database clusters. It supports Postgres Pro and PostgreSQL 15 or higher.

pg_probackup3 includes all the key functionalities of the prior versions of the pg_probackup utility. Some less popular features may be missing at the moment, but will be implemented in the future.

As compared to pg_probackup, pg_probackup3 comprises the following new features and improvements:

  • Version independence: The same pg_probackup3 version can now be used with different versions of Postgres Pro or PostgreSQL, ensuring compatibility and flexibility.

  • API integration: pg_probackup3 can be integrated with various backup systems via API, thus offering centralized management of the backup process.

  • Work without SSH: pg_probackup3 can work without an SSH connection, enabling more effective and secure data transfer.

  • FUSE: pg_probackup3 introduces the new fuse command, which enables running a database instance directly from a backup without requiring a full restore, using the FUSE (Filesystem in User Space) mechanism.

  • Operation by unprivileged users: pg_probackup3 can be started by users who do not have access rights to PGDATA. This helps to increase security and reduce the risk of potential errors.

  • A new backup format: Each backup is now stored as a single file, making it easier to manage and store backups.

  • pg_basebackup support: In the BASE data source mode, it is now possible to leverage the pg_basebackup replication protocol for improved backup speed and efficiency.

  • PRO mode: pg_probackup3 introduces a proprietary replication protocol in the new PRO data source mode, available exclusively in Postgres Pro Enterprise.

  • Merging incremental backup chains: It is now possible to save disk space by merging chains of incremental backups.

  • Completely reengineered core

  • Redesigned architecture

  • Improved performance

Note

Certain pg_probackup3 functionalities rely on features specific to Postgres Pro Enterprise. These functionalities are automatically turned off for pg_probackup3 included in Postgres Pro Standard.

Installing pg_probackup3

pg_probackup3 includes the following packages:

  • libpgprobackup3 — contains a shared library providing the API for backup creation, as well as libpb3_encoder.so, a dynamic library to be loaded by the corresponding server extension.

  • pg_probackup3 — contains the command-line utility for managing backups.

Note

All packages have to be installed and uninstalled together, as pg_probackup3 and libpgprobackup3 only support the Postgres Pro version 15 and higher.

Note

Before installing pg_probackup3, make sure you have installed the pgpro_bindump module.

To install pg_probackup3, follow the steps below.

  1. Download the archive with packages

    Download the archive with packages using the provided link. The archive contains test repositories for building pg_probackup3 for the following operating systems:

    • Debian 12

    • Astra Linux Smolensk 1.8

    • Ubuntu 22.04/24.04

    • RHEL 9

  2. Extract the archive

    Extract the archive using the following command:

    tar -xvzf pbk3.tar.gz pbk3/
    
  3. Configure the repository

    1. Install the GPG key.

      The archive includes the keys directory containing the GPG key for connecting the repository. Install the key based on your system.

      • For Debian-based systems:

        sed -n '/^$/,/=$/p' "/path/to/pbk3/keys/GPG-KEY-POSTGRESPRO" | base64 -d | sudo tee "/etc/apt/trusted.gpg.d/postgrespro.gpg" > /dev/null
        
      • For RHEL-based systems:

        sudo rpm --import /path/to/pbk3/keys/GPG-KEY-POSTGRESPRO
    2. Connect the repository.

      • For Debian-based systems, create the file /etc/apt/sources.list.d/pbk3.list with the following content.

        • For Ubuntu 24.04:

          deb file:///path/to/pbk3/ubuntu noble main
          
        • For Ubuntu 22.04:

          deb file:///path/to/pbk3/ubuntu jammy main
          
      • For RHEL-based systems, create the file /etc/yum.repos.d/pbk3.repo with the following content:

        [pbk3]
        name=pbk3
        baseurl=file:///path/to/pbk3/rhel/9Server/os/x86_64/rpms
        enabled=1
        gpgcheck=1
        
  4. Install the packages

    • For Debian-based systems, after connecting the repository, update the package list:

      sudo apt update
      

      Then install the required packages:

      sudo apt install libpgprobackup3 pg-probackup3
      
    • For RHEL-based Systems, install the packages using yum:

      sudo yum install libpgprobackup3 pg-probackup3
      

      Or dnf:

      sudo dnf install libpgprobackup3 pg-probackup3
      
  5. Verify the installation

    Ensure that the packages are installed correctly.

    1. Check the Postgres Pro version:

      /opt/pgpro/ent-16/bin/postgres --version
      
    2. Check the pg_probackup3 version:

      pg_probackup3 --version
      
  6. Configure Postgres Pro for pg_probackup3

    To enable pg_probackup3, add the following parameters in the postgresql.conf file:

    shared_preload_libraries = 'pgpro_bindump'
    wal_level = 'replica'  # or 'logical'
    walsender_plugin_libraries = 'pgpro_bindump'
    

Once the installation is complete, it is required to restart the Postgres Pro instance.