Backup PostgreSQL
Archive PostgreSQL databases with ColdPlane.
This guide covers archiving PostgreSQL databases to cold storage using ColdPlane.
Prerequisites
- PostgreSQL 9.6 or later
- A user with
SELECTpermission on target tables - ColdPlane CLI installed
Create the Backup
coldplane backup create \
--db-url "postgres://readonly:password@db.example.com:5432/production" \
--tables "users,orders,products"Both postgres:// and pg:// connection schemes are supported.
Verify the Backup
coldplane backup list
coldplane backup describe <backup-id>Tuning Performance
For large tables, you can adjust the chunk size and number of parallel workers:
coldplane backup create \
--db-url "postgres://readonly:password@db.example.com:5432/production" \
--tables "events,logs" \
--chunk-size 5000000 \
--workers 8Use a read replica connection string for production databases to avoid impacting query performance.
Local Mode
You can archive PostgreSQL tables locally without a ColdPlane account. Local backups are stored as Parquet files on your machine.
coldplane backup create --local \
--db-url "postgres://user:pass@localhost:5432/mydb" \
--tables "users,orders"Local backups are saved to ~/.coldplane/backups/<name>/. You can list them
with:
coldplane backup list --localQuery them directly:
coldplane query run --local \
--backup-id <backup-name> \
--sql "SELECT count(*) FROM restore_input"And delete when no longer needed:
coldplane backup delete --local <backup-name>Local mode is a great way to try ColdPlane. When you are ready for encrypted
cloud storage and team features, sign up and
drop the --local flag.