Incremental/differential backup and restore
If you have performance problems with a backup of a large PostgreSQL database, then you may consider incremental or differential backups.
An incremental backup is a backup of all files that have changed since the last backup, either incremental or full. In order to restore a given incremental backup, you must restore the full backup and then all of the incremental backups in-between.
A differential backup is a backup of all individual changes since the last full backup. In order to restore a differential backup, you only need that backup and the full backup it refers to.
How to do it…
To perform a differential physical backup, you can use rsync
to compare the existing files against the previous full backup and then overwrite only the changed data blocks. It's a bad plan to overwrite your last backup because, if the new backup fails, you are left without backups. Therefore, keep two or more copies. An example backup schedule is as follows:
Day of the... |