Backup & Restore¶
Kubernetes¶
- Backup and restore PostgreSQL deployments
- Migrate Data Between Kubernetes Clusters with Bitnami and Velero
Use custom format (recommended)¶
With this, you can use pg_restore with more options (like clean all DB objects before restoring).
Backup:
Restore:
DROP DATABASE openproject;
CREATE DATABASE openproject;
pg_restore -d openproject /var/backups/postgres/openproject.pg_dump
Unfortunately, this didn't work:
Convert custom dump format to sql
Using plain sql dump format¶
https://www.postgresql.org/docs/9.4/static/backup-dump.html
Backup:
Restore:
Storing dumps in version control¶
- akaihola/pgtricks Handy helpers for PostgreSQL users
Usage: