
Incremental Backup with PostgreSQL 17
With PostgreSQL 17 incremental backups wer introduced in a built in way. This article describes the result of a workshop dedicated to study this new feature. The Setup We used the following docker composition to simulate the a cluster with traffic that we want backed up. For this we created the following docker-compose.yml with several containers: services : postgres_main : image : postgres:17 environment : POSTGRES_PASSWORD : postgres POSTGRES_USER : postgres POSTGRES_DB : testdb PGDATABASE : testdb volumes : - ./docker-entrypoint-initdb.d:/docker-entrypoint-initdb.d - pg_data:/var/lib/postgresql/data - wal_archive:/mnt/wal_archive - full_backup:/mnt/full_backup - incremental_backup:/mnt/incremental_backup command : > postgres -c archive_mode=on -c archive_command='cp %p /mnt/wal_archive/%f' -c summarize_wal=on postgres_restore : image : postgres:17 profiles : - restore environment : POSTGRES_PASSWORD : postgres POSTGRES_USER : postgres POSTGRES_DB : testdb volumes : - pg_data_restore
Continue reading on Dev.to Tutorial
Opens in a new tab



