Skip to content

Version v3.7.0 of the documentation is no longer actively maintained. The site that you are currently viewing is an archived snapshot. For up-to-date documentation, see the latest version.

Backup

Backup and point-in-time recovery

Pigsty uses pgBackRest to manage PostgreSQL backups, it may be the most powerful open-source backup tools in the ecosystem. With incremental / parallel backup & restore, encryption, MinIO / S3 support, and many other features. Pigsty has pre-configured it for every PGSQL cluster by default.

Policy
    Backup scripts, scheduling, pgbackrest, repo and admin
Admin
    Backup policy, disk planning, recovery window trade-off
Restore
    Restore to specific time point with playbook
Example
    Sandbox example: Perform recovery with bare hands
NO WRANTTY

Pigsty try its best to provide a reliable PITR solution, but we do not take any responsibility for the data loss caused by the PITR operation, use it at your own risk. For professional support, consider our pro service.


Quick Start

Step 1

    [Backup Policy](/docs/pgsql/backup/mechanism): Schedule Base Backups with Crontab

Step 2

    [WAL Archiving](/docs/pgsql/backup/policy): Continuously record write activities

Step 3

    [Restore & Recovery](/docs/pgsql/backup/restore): Recover from backup and wal archive
Full backup everyday 1am
node_crontab: [ '00 01 * * * postgres /pg/bin/pg-backup full' ]
restore to a timepoint
./pgsql-pitr.yml -e '{"pg_pitr": { "time": "2025-07-13 10:00:00+00" }}'

Backup script, schedule, repository, and infrastructure

Backup storage repository for PostgreSQL

Design backup policy according to your needs.

Manage backup repo and backups

Restore PostgreSQL from Backup

Perform PITR manually in sandbox according to hint script