Upgrade PostgreSQL 12 to 16 with no downtime window in a healthcare estate
Typical situation: a healthcare software estate on PostgreSQL 12 with a 1.5 TB database that cannot take an overnight outage and must keep its audit trail continuous. Two methods fit. pg_upgrade with --link is fast but leaves the old cluster unusable once the new one starts, so the rollback has to be designed before the window. Logical replication to a new PostgreSQL 16 cluster keeps the old one live and untouched, and PostgreSQL documents that it can run between major versions. OSStend picks the method per database, writes the rollback, rehearses on a copy and runs the cutover. The cluster stays in your cloud account. Background on the engine is on managed PostgreSQL.
45 minutes with an engineer: we review your workload and sketch the design.
- ✓Move
- ✓PostgreSQL
- ✓Your cloud account
- Source
- PostgreSQL 12, about 1.5 TB
- Target
- PostgreSQL 16 in your account
- Methods
- Logical replication, or pg_upgrade --link
- Rollback
- Old cluster kept intact (replication method)
- Typical timeline
- 4 to 8 weeks with rehearsals
Typical situation
Trigger. The estate must leave version 12 but cannot afford an overnight outage or a gap in the audit log.
Versions. PostgreSQL 12 to PostgreSQL 16, four major versions.
- Continuous audit trail
- Rollback must be proven
- Extensions must exist on 16
A typical situation, not a named customer.
To upgrade PostgreSQL 12 to 16 with minimal downtime, either run pg_upgrade --link in a short window after a rehearsal, or build a 16 cluster and move by logical replication with the old cluster live. Logical replication keeps the old side intact for rollback. Sequences and schema changes need manual handling.
Customers
Partners
- PostgreSQL
- MySQL
- MongoDB
- Redis
Valkey
- OpenSearch
- Kafka
- RabbitMQ
- AWS
- Google Cloud
- Azure
- Kubernetes
- OpenShift
- Prometheus
- Grafana
- Datadog
- Dynatrace
- Splunk
What OSStend runs and what you keep
OSStend picks and runs the upgrade method, rehearses it and owns the cutover. You own the application tests and the sign-off.
| Area | OSStend | You |
|---|---|---|
| Cluster design | An engineer writes the design: size, replica layout, versions, extensions and settings. You sign it off before anything is built. | Approve the design and name the change windows. |
| Build and move | Builds the target and owns the move, with both sides live until you switch. | Point the application at the new endpoint on the agreed day. |
| Backups and recovery | Base backups, continuous WAL archiving and restore tests, with point-in-time recovery. | Say how far back you must be able to recover. |
| Failover | Detects a dead primary and promotes a replica; checks the old primary before it rejoins. | Use connection retry in the application. |
| Upgrades and patching | Minor releases and major upgrades on your change calendar. | Set the freeze dates. |
| Monitoring and on call | Replication lag, oldest transaction ID age, bloat, WAL archiving and disk, with engineers on call 24/7. | Receive the alerts you want forwarded. |
| Application and schema | Advice on queries and indexes found during the review. | Your schema, your queries, your releases. |
| Contract | One contract, one on-call team, price quoted per design. | Run application and audit tests against the new version. |
Where it can run
The upgrade can happen in any placement; this situation assumes your cloud account. The PostgreSQL licence is the same for every version.
| Option | When it fits | Licence and source |
|---|---|---|
| Your cloud account | The estate already runs in your account. | PostgreSQL License, a permissive licence similar to BSD or MIT (PostgreSQL project, checked 23 Nov 2026). It places no limit on where a managed service runs. |
| Our cloud | You want the new cluster hosted by us. | PostgreSQL License, a permissive licence similar to BSD or MIT (PostgreSQL project, checked 23 Nov 2026). It places no limit on where a managed service runs. |
| Your data center | The cluster is on premises. | PostgreSQL License, a permissive licence similar to BSD or MIT (PostgreSQL project, checked 23 Nov 2026). It places no limit on where a managed service runs. |
How the move works
Rehearse first on a restored copy, then run the method on production. The commands below are the replication path; the in-place path follows pg_upgrade's documented steps.
Compatibility check (2 to 5 days)
Extensions, removed features and application SQL are checked against 16 on a restored copy.
Choose and design (3 to 5 days)
In-place with --link, or logical replication, is chosen from database size and rollback needs.
Rehearse (1 to 2 weeks)
The method runs end to end on a copy and is timed.
Build and sync (1 to 3 weeks)
For replication: the 16 cluster is built and subscribed. For in-place: replicas are rebuilt after.
Cut over (one change window)
Writes pause, sequences are set, and the application reconnects. In-place runs pg_upgrade here.
Analyze and run (days after)
Optimizer statistics are rebuilt and the cluster is watched through a full business cycle.
Time ranges are typical for databases of this size and are fixed in the design you sign off. The method, the order and the checks do not change with the range.
pg_upgrade --check -b /usr/lib/postgresql/12/bin -B /usr/lib/postgresql/16/bin \ -d /data/12 -D /data/16 pg_upgrade --link -j 8 -b /usr/lib/postgresql/12/bin -B /usr/lib/postgresql/16/bin \ -d /data/12 -D /data/16 vacuumdb --all --analyze-in-stages --missing-stats-only vacuumdb --all --analyze-only
Cost basis
A major upgrade costs engineering time and a temporary second cluster. With replication, you pay for two clusters during the overlap. OSStend's fee is quoted per design.
Use the AWS RDS list as a yardstick for a 4 vCPU, 32 GiB node with 1,536 GB of storage: the overlap adds about one more such cluster for the weeks the two sides run.
| Method | Extra infrastructure | Rollback |
|---|---|---|
| Logical replication | A second full cluster for 1 to 4 weeks | Old cluster untouched; switch back |
| pg_upgrade --link | Little; hard links share files | Old cluster unusable after the new one starts |
| pg_upgrade copy mode | Space for a full second copy | Old cluster kept |
| Dump and restore | A second cluster plus a long outage | Old cluster kept |
Reference node: db.r7g.xlarge $0.478 x 730 = $348.94 a month and 1,536 GB gp3 x $0.115 = $176.64, AWS Price List file for Amazon RDS in us-east-1 (version 20261120224619, published 20 Nov 2026), US East, on demand, USD, 730-hour month, checked 23 Nov 2026. Excludes data transfer, backup storage beyond the free allocation, Reserved Instance discounts and taxes. pg_upgrade options: PostgreSQL docs, checked 23 Nov 2026.
What we watch on call
Upgrades fail in the details, not the headline step. These are the patterns we check before and after.
- Extension versions.
- An extension missing or older on 16 stops the restore. Signal: errors in the rehearsal.
- Planner changes.
- New plans can slow a query. Signal: slow query log compared with a baseline.
- No statistics after pg_upgrade.
- Plans are bad until analyze runs. Signal: missing statistics.
- Slot WAL growth on 12.
- Signal: slot lag in bytes during the sync.
- Sequences not replicated.
- Signal: sequence below table maximum.
- Rollback not tested.
- Signal: the rehearsal skipped the switch-back.
When OSStend is not the right fit
A designed upgrade fits when the cost of an outage or a bad plan is high. A small internal database can use dump and restore.
Contact us if
- ✓An overnight outage is not acceptable.
- ✓You need a rehearsed rollback.
- ✓Several extensions and large tables are involved.
Not a fit if
- ✕The database is small and a window is fine.
- ✕You already have a tested upgrade team.
- ✕The application cannot be tested before the window.
Questions buyers ask
Can logical replication run from 12 to 16?
PostgreSQL documents that logical replication can run between different major versions (PostgreSQL docs, checked 23 Nov 2026). Schema and sequences need separate handling.
Why not always use pg_upgrade --link?
It is fast, but PostgreSQL warns the old cluster cannot be used once the new one starts. The rollback must be planned before the window.
Do we need to analyze afterwards?
Yes. pg_upgrade does not carry optimizer statistics, so vacuumdb runs afterwards.
Plan your major upgrade with an engineer
Share your version, size and extensions. An engineer will pick the method and write the rollback.
- ✓A design sketch for your workload, not a plan menu
- ✓A zero-downtime cutover path for what you run today
- ✓A price for that design, after the review





