Engineering & Industrial Services
PostgreSQL (12 → 15 → 17), Linux, repmgr, Barman
Upgrading a 5TB PostgreSQL Environment Under Replication Constraints
Challenge
Upgrade a PostgreSQL 12 environment consisting of a primary and standby database (~5TB) under significant constraints:
- Limited available disk space (no capacity for parallel rebuild)
- Tight maintenance window
- Requirement to maintain replication and data integrity
- Dependency on repmgr compatibility, requiring a staged upgrade path
A direct upgrade to the target version was not feasible due to third party replication module compatibilty constraints.
Solution
Designed and executed a controlled, staged upgrade strategy aligned with both operational constraints and replication module requirements.
Key elements included:
- Performed upgrade in stages (12 → 15 → 17) to maintain compatibility with repmgr
- Selection of an in-place upgrade approach to avoid additional storage requirements
- Careful coordination of upgrade steps between primary and standby systems
- Validation of configuration, extensions, and compatibility
- Controlled execution with defined procedures to ensure consistency
Outcome
- Successful upgrade from PostgreSQL 12 to version 17
- Replication maintained and re-established cleanly at each stage
- Upgrade completed within the available time and storage constraints
- Stable and reliable post-upgrade environment