Interview Prep/Docker/Operations, Rootless & Podman

How do you handle upgrading a database container image version (e.g., Postgres 15 to 16)?

AdvancedProductionOperations, Rootless & Podman
Answer

Changing the tag against an existing data directory fails: database files are incompatible with server. Take a backup (pg_dumpall), start the new version on a fresh volume and restore, or use pg_upgrade with both binaries (tianon/postgres-upgrade image). Test on a copy, and plan downtime or logical replication for large datasets.

All Docker questions Roadmap: Docker & containers

More on Operations, Rootless & Podman