# db-cutover

> Agent-friendly CLI and runbook for PostgreSQL blue/green upgrades using logical replication and PgBouncer

Source: https://talira.ai/catalog/db-cutover-2dq5yh5a
Every listing: https://talira.ai/catalog.md

- Kind: Open source
- Verified: its makers verified it through docspring.com, since 21 Nov 2026
- Types: Command-line tool
- Categories: [databases / postgres / migration](https://talira.ai/categories/databases/postgres/migration), [devops / operations](https://talira.ai/categories/devops/operations)
- Platforms: cli
- Licence: MIT
- Pricing: Free and open source
- Free tier: yes
- Self-hostable: yes
- Backed by: [DocSpring](https://talira.ai/orgs/docspring.md)

db-cutover upgrades a [PostgreSQL](https://talira.ai/catalog/postgresql-cm55wcnd.md) database on RDS by copying it to a new instance at the target version, keeping the copy current with logical replication, and switching application traffic through [PgBouncer](https://talira.ai/catalog/pgbouncer-ke0bbbm9.md) in [Kubernetes](https://talira.ai/catalog/kubernetes-ftsegx3m.md). The application keeps using the old database during the copy; at the switch, PgBouncer holds new queries while in-flight transactions finish, then sends the queued work to the new instance. It's a Python CLI with a step-by-step procedure and design notes, meant for a human operator working with a coding agent: each command has a narrow purpose, and every command that changes database, infrastructure or PgBouncer state needs `--execute`. It also does preflight checks, schema copy, sequence sync, verification, synthetic write probes, rehearsals and [Terraform](https://talira.ai/catalog/terraform-zdejdqmx.md) helpers for the new instance.

## Links

- GitHub: https://github.com/DocSpring/db-cutover
- Docs: https://github.com/DocSpring/db-cutover/blob/main/docs/procedure.md

## Problems it solves

- upgrade our RDS Postgres major version without taking the app down
- RDS blue/green deployments don't fit our setup and I want control over the switchover
- move production traffic to a new Postgres instance with no failed requests
- pause PgBouncer while in-flight transactions finish, then point it at the new database
- keep a copy of a live Postgres database in sync with logical replication until we're ready to switch
- sequences are behind on the replica after logical replication and inserts fail with duplicate keys
- I want a coding agent to help run a database migration, but every destructive step needs my explicit approval
- rehearse a database cutover before doing it for real
- verify the new Postgres instance has the same data as the old one before switching
- write synthetic probe rows during a migration to prove no writes were lost
- generate the Terraform for a new RDS instance at the target Postgres version
- zero-downtime Postgres 16 to 17 upgrade with PgBouncer in Kubernetes

## Features

- preflight checks
- prepare BLUE for logical replication
- Terraform for GREEN and for promoting it
- schema copy, replication start and sync wait
- data verification with an optional replicated marker write
- sequence sync
- PgBouncer pause, reload and resume cutover with rehearsal mode
- health and replication watch, synthetic write probes
- dry run by default; --execute for every change
- 1Password secret references

## Capabilities

- Has a command line tool: plan not known

## Trust

Overall: 0.29 out of 1.
Signals: maintenance 0.61, adoption 0.00, momentum 0.00, community 0.12, backing 0.30, extensibility 0.20.

- last commit 28 days ago
- 1 commits in the last 90 days
- 0 GitHub stars
- 1 contributors
- backed by DocSpring

Warnings:

- young project (first commit 28 days ago)
- one or two maintainers (bus factor)
