YugabyteDB · YB Aeon · YB Anywhere

ybchange
schema
governance.

The only migration tool that manages YugabyteDB as YugabyteDB. Colocation, geo-partitioned tablespaces, xCluster DDL sequencing, and tablegroup lifecycle — versioned in YAML. Other tools treat YugabyteDB as plain PostgreSQL and stop there.

19
CLI Commands
5433
YSQL Port
xCluster
DDL Aware
ybchange — yugabyte prod deploy
$ ybchange deploy --profile prod --tag 3.0.0
[scan] 4 forward, 2 undo
[lock] acquired rakesh-zenbook:a4f3b1
[RUN] V1.0.0__create_core_tables.sql 312ms
[RUN] V1.1.0__add_order_tables.sql 375ms
[RUN] V1.2.0__add_colocation.yaml 47ms
[WARN] xCluster: apply to TARGET first
[RUN] V1.3.0__add_geo_tablespaces.yaml 62ms
[audit] 4 events → ybchange_audit
✓ 4 applied · tag=3.0.0
$
Validated on YugabyteDB 2.20+ YugabyteDB Aeon YugabyteDB Anywhere YSQL (PostgreSQL 15 wire) xCluster Replication Geo-Partitioned Clusters
Why ybchange

Beyond
PostgreSQL migrations.

Other tools connect to YSQL port 5433 and run SQL. ybchange goes further — it understands what makes YugabyteDB different and manages those features as first-class migration objects.

Key Differentiator
Colocation ID for xCluster Bootstrap
YugabyteDB xCluster replication requires colocation_id to be identical on source and target universes. ybchange is the only tool that versions colocation_id as part of the migration — Other tools have no concept of colocation at all. If you set up xCluster without matching colocation IDs, replication bootstrap fails silently.
Key Differentiator
Geo-Partitioned Tablespace Lifecycle
YugabyteDB tablespaces are not PostgreSQL tablespaces. They carry replica_placement JSON with cloud/region/zone/min_replicas constraints that control where data physically lives. ybchange versions these placement policies as YAML — including multi-region failover and data residency for GDPR.
YAML Migrations

YugabyteDB-native
as code.

SQL handles tables and indexes. YAML handles everything else — the distributed topology configuration that Other tools have no vocabulary for.

# V1.2.0__add_colocation.yaml
# colocation_id MUST match on xCluster source + target
 
colocation:
  - table: orders
    colocated: true
    colocation_id: 20001  # required for xCluster bootstrap
  - table: order_items
    colocated: true
    colocation_id: 20002
 
# V1.3.0__add_geo_tablespaces.yaml
tablespaces:
  - name: us_east_ts
    replication_factor: 3
    placement_blocks:
      - cloud: aws
        region: us-east-1
        zone: us-east-1a
        min_num_replicas: 1
 
xcluster_hint:
  apply_to_target_first: true  # warning emitted pre-deploy
  tables: [orders, order_items]
Capabilities

Every command
YB-aware.

🌍
Geo-Partitioned Tablespaces
Create and version YugabyteDB tablespaces with replica placement JSON. Cloud, region, zone, and min_num_replicas — tracked as YAML migrations.
YAML NATIVE
🔗
Colocation & Tablegroups
Version tablegroup membership and colocation_id together. The colocation_id is critical for xCluster replication bootstrap — ybchange ensures it matches on both universes.
XCLUSTER SAFE
🔁
xCluster DDL Sequencing
Emit warnings when a migration should be applied to the target universe before the source. Prevents xCluster replication breakage on schema changes.
ADVISORY
📸
Baseline Generation
Introspect a live YugabyteDB cluster and emit V0.0.0__baseline.sql with CREATE TABLE DDL, plus a YAML file capturing tablespaces, tablegroups, and colocated tables.
INTROSPECT
📈
OLS Capacity Projections
Daily snapshots of row counts per table. OLS linear regression projects 180-day growth with confidence scoring. Flags tables at risk before they become a problem.
180-DAY OLS
🔍
psycopg2 YB Workaround
YugabyteDB triggers a psycopg2 RealDictCursor bug on ANY parameterised query. ybchange uses psycopg2.extensions.adapt() to substitute params without passing them to the driver.
DRIVER PATCH
Release tagging
Stamp every deploy with a release label. Roll back an entire release with ybchange rollback --tag release-2.1 — undoes all migrations applied under that tag, newest first.
Status with tag column
Migration history shows VERSION, STATUS, ELAPSED, TAG, and SCRIPT. Filter by tag with ybchange status --tag release-2.1 to see exactly what shipped.
Drift detection
Compare live schema against migration history. Detects tables, tablespaces, and tablegroups that exist in the database but have no corresponding migration.
Immutable audit log
Every deploy, rollback, and lock event written to ybchange_audit. Operator identity, run ID, tag, timestamp — captured automatically. SOC2 / HIPAA ready.
Comparison

ybchange vs
alternatives

Other tools connect to port 5433 and calls it done. ybchange manages the distributed topology layer.

CapabilityybchangeOther toolsPlain psycopg2
SQL DDL migrationsmanual
Colocation + colocation_id✓ YAML
Geo-partitioned tablespaces✓ YAML
xCluster DDL sequencing hints✓ advisory
Tablegroup lifecycle✓ YAML
psycopg2 RealDictCursor workaround✓ adapt()
Release tagging + grouped rollbackbasic
Drift detection
OLS capacity projections✓ 180-day
Baseline generation✓ SQL + YAMLSQL only
Immutable audit logbasic
Installation

Start in
two minutes.

$ pip install ybchange
Python 3.9+ · psycopg2-binary · pyyaml · YugabyteDB 2.14+
# YugabyteDB YSQL listens on port 5433, not 5432
# ybchange.yml — local profile
profiles:
  local:
    host: localhost
    port: 5433    # ← YSQL port
    user: yugabyte
    database: yugabyte