Containerized PostgreSQL major-version upgrades via pg_upgrade. Supports PG 9.6–16.
10K+
Docker images that automate PostgreSQL major-version upgrades using pg_upgrade, built for teams running containerized PostgreSQL in production.
Each image contains both the old and new PostgreSQL binaries. The upgrade runs in three isolated container steps connected by Docker volumes (or Kubernetes PersistentVolumeClaims), so no data ever leaves your infrastructure.
| From ↓ To → | PG 12 | PG 13 | PG 14 | PG 15 | PG 16 |
|---|---|---|---|---|---|
| PG 9.6 | 9.6-to-12 | 9.6-to-13 | 9.6-to-14 | 9.6-to-15 | 9.6-to-16 |
| PG 10 | — | — | 10-to-14 | 10-to-15 | 10-to-16 |
| PG 11 | — | — | 11-to-14 | 11-to-15 | 11-to-16 |
| PG 12 | — | — | 12-to-14 | 12-to-15 | 12-to-16 |
| PG 13 | — | — | — | 13-to-15 | 13-to-16 |
| PG 14 | — | — | — | — | 14-to-16 |
| PG 15 | — | — | — | — | 15-to-16 |
# Step 1 — seed the old cluster with test data
docker run --rm \
-v pg-old-data:/var/lib/postgresql/13/main \
abhsss/pg-upgrade:13-to-16 init-old
# Step 2 — run pg_upgrade (prints before/after snapshots and timing)
docker run --rm \
-v pg-old-data:/var/lib/postgresql/13/main \
-v pg-new-data:/var/lib/postgresql/16/main \
abhsss/pg-upgrade:13-to-16 upgrade
# Step 3 — verify integrity of the upgraded cluster
docker run --rm \
-v pg-new-data:/var/lib/postgresql/16/main \
abhsss/pg-upgrade:13-to-16 verify
pg_xlog → pg_wal, pg_clog → pg_xact, etc.)analyze_new_cluster.sh and delete_old_cluster.sh scriptspg_database)pg_upgrade works directly on data files as the postgres OS user. No database password is involved at any stage of the upgrade.
The image runs unmodified on Kubernetes. Replace Docker volumes with PersistentVolumeClaims and docker run with Jobs. Full manifests and step-by-step instructions are in the GitHub repository.
Content type
Image
Digest
sha256:98158823d…
Size
187.7 MB
Last updated
3 months ago
docker pull abhsss/pg-upgrade:11-to-14-ce501f1b733a4a441ec46b95e41833c4cbe289b0