Net-Base Magazine

27.08.2026

PostgreSQL upgrade without downtime: Blue/Green, replication and rollback plan for production ERP databases

How to upgrade PostgreSQL in production ERP environments without downtime: Blue/Green approach, replication variants, cutover design and a robust rollback plan — with a focus on operations, interfaces and data consistency.

27.08.2026

From magazine topic to project implementation

Relevant service and technical pages for this post

A PostgreSQL upgrade without downtime sounds at first like a promise from the cloud world. In the reality of a productive ERP database it is more a discipline: you must make data consistency, interface behavior, batch runs, reporting, permissions and operational processes work together so that the actual version change is no more than a controlled switch moment. “Without downtime” is rarely to be understood absolutely. In practice it means: no noticeable interruption for users, no unplanned rollbacks, no hours-long locks — and above all a fallback path that actually works.

This article positions the typical upgrade paths for PostgreSQL in ERP environments — with Blue/Green, replication (physical and logical) and a rollback plan that is not only on paper. The focus is intentionally on operations and decision questions: which architecture is required? Where are the risks? Which preparatory tasks consume time? And how do you prevent an upgrade from failing because of side issues like drivers, job chains or unclear data ownership?

Why ERP databases are especially sensitive during upgrades

ERP systems are OLTP-heavy (Online Transaction Processing), optimized for many short transactions: writing documents, posting inventory movements, calculating prices, posting payments. These transactions rely on clear expectations: latency must be stable, locks must not escalate, and the system must remain predictable under peak load.

A PostgreSQL upgrade affects exactly this stability — even if the application remains unchanged. Causes include, among others:

  • Changes in the query optimizer (planner): Queries can suddenly choose different execution plans. That is not “wrong”, but under load it can create new hotspots.
  • Parameter and default changes: Configuration values or their default behavior change across major versions. This affects, for example, autovacuum, WAL (Write-Ahead Log, the transaction log) or work_mem.
  • Driver and protocol issues: ODBC/JDBC/Npgsql versions, SSL/TLS parameters, authentication (e.g. SCRAM vs. MD5) and certificate chains are often hidden blockers.
  • Integration ecosystem: ERP rarely means “just one application”. Reporting, EDI, web services, ETL/BI, document management and batch integrations access the database — directly or indirectly.

The consequence: an upgrade is not just a database change. It is a coordinated release across application, operations and adjacent systems. That is precisely why Blue/Green and replication are so valuable: they decouple the technical switch from the risk of a long maintenance window.

Define goals precisely: “without downtime” does not mean “no switching”

Before you choose an architecture, it is worth defining clear goals along operational metrics:

  • RTO (Recovery Time Objective): How quickly must the ERP database be reachable and stable again after a failure?
  • RPO (Recovery Point Objective): How much data (time span) may be lost in the worst case? For true zero-downtime migrations the goal is often RPO≈0.
  • Maintenance window: Is there a “small” window (e.g. a few minutes) for a cutover, or none at all? In ERP a switch is usually possible if it is plannable (avoid shift changes, month-end).
  • Acceptance of read-only phases: Sometimes a short „read yes, write no“ phase is functionally acceptable, provided postings are not lost.
  • These objectives determine whether you can work with replication plus cutover or whether you additionally need mechanisms for write decoupling (e.g., queuing in interfaces). Those who remain vague here will pay later with improvisation during the go-live.

    Blue/Green for PostgreSQL: principle, benefits, common pitfalls

    Blue/Green means: two complete environments exist in parallel. „Blue“ is production, „Green“ is the new version. The decisive advantage is not only the ability to switch, but the testability under realistic conditions: Green can be validated with production-like data, real interfaces and real monitoring before users switch.

    For PostgreSQL in the ERP context, Blue/Green typically includes:

    • a separate PostgreSQL cluster (Green) on new hosts/VMs or separate instances
    • identical network and security parameters (firewall, TLS, DNS resolution, service accounts)
    • a defined data migration (initial copy + delta)
    • a cutover mechanism (DNS/VIP switch, connection-string switch, proxy)

    What Blue/Green actually delivers operationally

    In practice there are three points that make the difference:

    • Rollback is fast: You roll back in case of failure, instead of repairing an upgrade „backwards“.
    • Risk reduction through pre-validation: Green can undergo performance and functional checks, including typical ERP load (batch runs, printing, posting waves).
    • Clean separation of database and application risk: When Green is running, many unknowns are already clarified (drivers, authentication, extensions, parameters).

    The most common Blue/Green failure scenarios

    Blue/Green rarely fails on the concept; it fails on details:

    • Incomplete dependencies: Reporting tools or integrations hard-code access to the old host (IP, alias, certificate pinning). During cutover they get stuck.
    • Unclear ownership of interfaces: No one feels responsible for ensuring that all consumers switch over or at least are tested.
    • Missing data validation: „Data are replicated“ does not mean that everything is correct from a business perspective (e.g., sequences/identities, timestamps, subledger logic).

    Replication as an upgrade tool: physical vs. logical

    Schematische Darstellung von physischer und logischer Replikation zwischen zwei Datenbankknoten
    Physical replication works close to the WAL, logical replication transfers table changes – important for major upgrades.

    For a PostgreSQL upgrade without downtime, replication is usually the core mechanism to keep data in sync in parallel. PostgreSQL provides several approaches with different trade-offs. Important: “replication” is not automatically “high availability”. For upgrades, use replication as a migration bridge.

    Physical replication (Streaming Replication): fast, close to the machine

    Physical replication operates at WAL level: the standby receives the transaction log and replays it. This is performant and stable, but with a central caveat for major upgrades: typically Primary and Standby must match the same major version. For a version jump, e.g. PostgreSQL 13 to 16, physical replication therefore helps mainly within a version (HA, maintenance), not as a direct major-upgrade path.

    Practical benefit in an upgrade project still arises when you use physical replication as a safety net in the Blue system: before the cutover you can ensure the existing production is redundant while you build Green in parallel.

    Logical replication: delta transfer via publications/subscriptions

    Logical replication transfers changes at table level (INSERT/UPDATE/DELETE) and is therefore suitable for major upgrades because publisher and subscriber can run different major versions (subject to compatibility considerations). For ERP databases this often is the most practical way to achieve a minimal switch window.

    Typical characteristics you should plan for:

    • Initial snapshot + ongoing changes: The dataset is copied initially and subsequent changes are applied.
    • DDL is not replicated automatically: Schema changes (DDL, i.e. tables/columns/indexes) are not replicated like data changes. For upgrades this is acceptable because the schema usually remains the same — but extensions, roles and privileges must be migrated consciously.
    • Sequence/identity issues: Sequences (e.g. for document numbers) are critical in ERP. Depending on the setup you need to ensure sequence states are consistently transferred and continued correctly after cutover.
    • Conflict-free operation: During the replication phase writes should occur on only one side. Otherwise conflicts arise that are hard to resolve in ERP operation.

    The upgrade path in practice: a robust process model

    Operations team plans cutover steps for a database switch with runbook and status checks
    Cutover succeeds when steps, checkpoints and abort criteria are rehearsed like a runbook.

    Regardless of the exact tooling, a downtime-minimized upgrade in ERP environments usually proceeds in clearly defined stages. A practical structure is:

    1) Pre-analysis: What actually needs to move?

    This is not about “Install PostgreSQL X”, but about dependencies:

    • Extensions (e.g. for full text, jobs, special data types): Which are actively used in production, which are historical artifacts?
    • Auth and roles: local roles, LDAP/AD integration, SCRAM, certificate authentication. Role and permissions export is a separate step.
    • Jobs and batch runs: Is scheduling executed externally (e.g., via a job server) or in the database (e.g., via extensions)? Which jobs are cutover-critical (night processing, invoicing, MRP)?
    • Consumer landscape: Who reads/writes? ERP backend, web portals, integration services, BI/ETL, partner connections, DMS, monitoring.

    A simple but effective artifact is an application map: database in the middle, arrows to all systems including owner and switchover method (DNS, configuration, secret, proxy). That prevents the cutover from failing due to „forgotten“ readers that suddenly timeout.

    2) Build Green: not just the database, but operational readiness

    Green only makes sense when it is operationally real. This includes:

    • Monitoring (metrics, logs, alerts): the same visibility as in Blue, otherwise the go-live is blind.
    • Backup/RESTore: Backups on Green must work, including RESTore testing (at least spot checks). Only this way is it clear you won’t lose data twice in case of a failure.
    • Security parity: TLS configuration, ciphers, certificate chain, HBA rules (Host-Based Authentication), firewall. ‚Hardening later‘ will backfire during switchover.
    • Performance baseline: storage latency, IOPS, CPU, RAM. An upgrade is a good opportunity to correct unfavorable storage classes or outdated VM profiles.

    3) Data migration: initial copy and delta phase

    For large ERP databases the initial copy is often the longest step. It does not have to be in the maintenance window if you decouple it cleanly. Crucial is that the delta phase (replication) runs stably and is monitored: lag, errors, outstanding changes.

    Operationally important: define thresholds for when to attempt the cutover at all. If Green consistently lags behind, switching is possible but you transfer the problem into the live system.

    4) Validation: functional and technical, without perfectionism

    Validation is not a months-long test project, but more than ‚SELECT COUNT(*)‘. In ERP environments the following checks work well:

    • Spot checks on critical tables: open items, inventory balances, document headers/line items, pricing tables, debtor/creditor.
    • Aggregate comparisons: sums over defined periods (revenue, quantities) to quickly spot major divergences.
    • Technical metrics: index and statistics status, autovacuum activity, replication lag, connection limits, query latencies.

    The important decision is what acceptance actually needs. An upgrade is not a functional release. You want to prove: same data, same behavior, stable performance. For that, robust, reproducible checkpoints are sufficient.

    5) Cutover: the switchover must operate like a runbook

    The cutover itself is rarely complex, but it is time-critical. A good runbook describes not only steps, but also checkpoints and abort criteria. Typical components:

    • Control the write stop: either via the application’s maintenance mode or via a technical lock (e.g., severing connections for write roles). Goal: no new writes on Blue in the final phase.
    • Bring replication to ‚zero‘: wait until Green has all changes (RPO≈0).
    • Switching the application: Connection strings, DNS, VIP, proxy rule. Crucial: consistent for all components, not just the ERP backend.
    • Smoke tests: login, open master data, post a document, representative report, interface ping. Short but meaningful.

    Rollback plan (Rollback) without illusions: what you can actually roll back

    Schematic switchover between Blue and Green database with rollback path
    Rollback is conflict-free only up to clearly defined phases — beyond that, data consistency becomes the main issue.

    The rollback plan is the part you prefer „not to need.“ Precisely for that reason it must be concrete. In Blue/Green setups the rollback is essentially a switch back to Blue. However: once production write operations occur on Green after the cutover, „going back“ becomes a functional problem if Blue has not received all those writes in the meantime.

    Rollback variants and their consequences

    • Immediate rollback before production writes: the ideal case. If you discover, before enabling users, that something is fundamentally wrong, you can switch back without data conflicts.
    • Rollback after a few writes: possible, but only with a clear strategy: either manual reconciliation (functional) or a temporary counter-replication/delta takeover (technical), which is rarely stress-free in ERP processes.
    • No rollback, but a „fix forward“: if Green is already writing in production and its dataset is the new „single source of truth“, switching back is often more dangerous than a targeted stabilization forward. This must be accepted as an option in advance.

    A robust rollback plan therefore explicitly specifies:

    • until when rollback is „safe“ (time window or phase in the runbook)
    • which abort criteria apply (e.g. smoke test failure, interface errors, implausible totals)
    • how communication and approvals are handled (who decides, who is informed)

    More important than the rollback: the „emergency operation“ for interfaces

    In ERP landscapes interfaces are the more frequent cause of hectic situations after a cutover. If partner connections or internal integration services suddenly stop delivering, you need an emergency operation: intermediate buffers (queues), restart rules, clear retry strategies. „Retry“ must be idempotent (repeatable without double posting). This is not a database function but application and integration design — yet it determines whether you can actually achieve an upgrade without downtime.

    Performance and stability after the upgrade: why the first 48 hours are decisive

    Many teams consider the upgrade „done“ once the cutover is complete. In practice, the phase then begins in which load profiles, cache behavior and autovacuum take time to settle. Typical measures that have proven effective:

    • Tight monitoring in the first 48 hours: query latencies, locks, I/O wait times, WAL volume, autovacuum runs.
    • Detect plan regressions: Individual queries that were previously „okay“ can dominate after the upgrade. Top-query lists and a clear escalation of who is allowed to tune (DBA vs. application team) help here.
    • Monitor reporting/ETL separately: Read-heavy tools are often the first to exhibit problems (long queries, new plans). Read Replicas can help, but they must fit into the overall concept.

    For IT leadership it is important: plan this stabilization as part of the change. An upgrade without downtime is not „no effort“, but effort at the right time and with controlled risk.

    Typical architecture decisions around ERP: DNS, connection strings, proxies

    The cutover is cleaner the more unambiguous the switch point is. Common variants:

    • DNS alias (e.g. db-erp.prod): simple, but TTL (Time To Live) and client caching can extend switchover times. For some drivers DNS caching is surprisingly persistent.
    • Virtual IP / load balancer: switching is technically fast, but you need a clear health-check concept, otherwise you may route into unstable states.
    • Connection string via configuration/secret: well controllable if you have centralized configuration distribution. Risk: not all components will pick up the new configuration simultaneously.
    • DB proxy: can help centralize the switchover, but adds additional complexity and introduces a new critical service into the chain.

    For grown enterprise software a mix is often realistic: central services switch via configuration, „legacy components“ via DNS. It is important that you document and test it in the runbook — including the „forgotten“ jobs on an old app server.

    Security and compliance: Upgrade as an opportunity, but not as a side battle

    PostgreSQL upgrades are a good occasion to close security gaps: outdated auth methods, overly broad roles, unclear network permissions. At the same time, security must not become uncontrolled scope creep.

    Pragmatic approach:

    • Security parity at cutover: Green must be at least as secure as Blue, preferably with small, clear improvements (e.g. TLS defaults, SCRAM instead of MD5, more RESTrictive HBA rules).
    • Follow up with larger refactors: Role refactoring, strict network segmentation or comprehensive secrets rotation are valuable, but better executed as their own change package after stabilization.

    Estimate effort realistically: Where projects lose time in practice

    For planning and communication an honest effort breakdown helps. In practice the time consumers are not „installing PostgreSQL“, but:

    • Consumer inventory: find all readers/writers, clarify owners, define the switchover path.
    • Test data and test environment: production-like data (with regard to data protection) and realistic load are crucial, otherwise you’ll test the wrong problem.
    • Runbooks and approvals: Who is allowed to do what during the maintenance window? Who decides on rollback? Who communicates? Without clarity delays occur at the critical moment.
    • Driver/TLS issues: small incompatibilities can produce large symptoms (sporadic disconnects, auth errors, timeouts).

    If you treat these items from the start as separate work packages, the „upgrade“ becomes a controllable project instead of a nervous weekend.

    Conclusion: PostgreSQL upgrade without downtime is primarily an operational design

    A PostgreSQL upgrade without downtime is not accomplished by a single trick but by an architecture that makes cutover and rollback controllable. Blue/Green provides the necessary separation, replication supplies the data bridge, and a realistic rollback plan prevents the team from having to choose between data loss and hours-long disruption in the event of a failure.

    If you properly inventory the consumer landscape, build Green as an operational environment (monitoring, backups, security), monitor the data takeover and rehearse the cutover as a runbook with abort criteria, the version jump becomes a controlled change — even for production ERP databases with many interfaces.

    If you want to prepare the upgrade of your ERP database in a structured way and consider architecture, interfaces and the rollback plan together, talk to us:

    Blue/Green deployment and a cutover plan are also important for this topic. The article places these aspects in a clear context and shows what matters in everyday operations.

    Discuss a project or modernization initiative with Net-Base.

    Next step

    When the topic becomes an actual project, architecture, existing systems and operations should be considered together from the outset.

    We support not only with individual issues, but also when source snippets, legacy topics, or portal ideas are to be turned into a robust enterprise project.

    • Current state, target state and technical risks are assessed jointly.
    • REST, data access, portals and rollout are not deferred to a later stage as secondary consequences.
    • You can see early on which path is economically and operationally viable.

    Share post

    Share this post directly

    LinkedIn, X, XING, Facebook, WhatsApp and e-mail are available immediately. For Instagram we will prepare the link and short text directly.

    Email

    Instagram opens in a new tab. The link and short text are copied to the clipboard beforehand.