WAL-G is a simple and efficient archival restoration tool for PostgreSQL that simplifies Continuous Archiving and Point-in-Time Recovery (PITR) and can store backups in S3, Google Cloud Storage, Azure, Swift, remote host (via SSH), or local file system.
In order to set up continuous backups, you need to do the following:
For example. If you use GCP GCS you should configure ENV Variables
archive_command = 'wal-g wal-push %p'
restore_command = 'wal-g wal-fetch %f %p'
For taking a backup you should run
wal-g backup-pushinside the AidboxDb container
wal-g backup-push $PGDATA
You can always restore the database from base backup if your database is corrupted.
wal-g delete retain FULL 30 --confirm
This will delete all but 30 latest backups.
wal-g wal-verify integrity timeline # perform integrity and timeline checks
wal-g wal-verify integrity # perform only integrity check
- 1.Configure WAL-G access to external storage
- 2.Download backup
- 3.Configure the
wal-g wal-fetchrestore command
- 4.Start Postgres
Postgres download all the missing logs and read them on start.
In replica mode Postgres operates in "read-only" mode, continues to receive WAL logs and lags minimum one WAL file behind main instance.
You can configure incremental backups with env variable
So the backup will be faster, but the recovery process will take longer.
- WAL-G is not a replacement of
pg_dumpis used to create a logical dump of one or several DBs in cluster.
- WAL-G doesn't schedule backup automatically.