PostgreSQL in Docker: Major Version Migration Without Data Loss
PostgreSQL doesn’t support in-place upgrades between major versions (15 → 17, 17 → 18). Data must be migrated logically: via dump and restore. Why it’s important: ✅ New versions = security fixes, optimizations, new features ✅ Support for modern clients (Nextcloud, Mastodon, Authelia require recent versions) ✅ Predictability: same process for any project Docker complexity: ❌ Can’t just change image tag - data format is incompatible ❌ pg_upgrade requires simultaneous access to old/new binaries - breaks container isolation ✅ Solution: pg_dumpall → new container → psql < dump 📋 Prerequisites Before starting, ensure: ...