Stepping into TAR backups (Intermediate)
For a very long time, the Unix tar
command was one of the only methods for obtaining a full binary backup of a PostgreSQL database. This is still the case for more advanced installations which may make use of filesystem snapshots, extensively utilize tablespaces, or otherwise disrupt the included management tools. For these advanced scenarios and more, tar
is indispensable for circumventing or augmenting the provided tools.
Getting ready
Please refer to the Getting a basic export (Simple) recipe on preparing a sample
database.
For the purposes of this example, we will assume that the database directory is /db
, and the archived files will go to /archive
. Based on this, we need to modify the postgresql.conf ...
Get Instant PostgreSQL Backup and Restore How-to now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.