A full migration lifecycle in one binary

Connect both ends, see what you have, move it, prove it landed correctly, then keep it in sync. Every step is a subcommand; every step is scriptable.

Setup wizard & doctor

a2h wizard connects both ends, detects the target edition, probes capabilities, round-trips a COPY to prove NULL-vs-empty-string fidelity, and writes a config.toml. a2h doctor validates the environment.

Assessment & report

a2h assess is read-only: object inventory, per-column type mapping with provenance, cost estimate, and a target-gap report. Output as text, JSON, or HTML.

Schema export

a2h export emits target DDL in load-safe order — tables, sequences, indexes, views, then FKs last — with a .review.sql companion for procedural objects that need a human eye.

Parallel, resumable load

a2h migrate moves schema and data: integer-PK-range chunked, parallel, manifest-tracked. COPY fast path or array INSERT. Crash-safe — a2h resume never duplicates a chunk.

Live monitor

a2h monitor is a full-screen dashboard — per-table progress, chunks, rows, ETA. --once prints a single snapshot for CI logs.

Type-override knobs

Ora2Pg-style global [data_type] and per-column [modify_type] overrides, each carrying provenance so a reviewer can see why a column was mapped the way it was.

Runtime capability probe

Adapts to what the live target actually supports — COPY, ON CONFLICT, RETURNING, MERGE, PL/pgSQL, CHECK/FK — with graceful degradation. It never assumes from a version string.

CLI, library, MCP

Drive it from the Typer + Rich CLI, import it as a Python library, or run a2h mcp serve to expose the engine to AI agents.

Four engines in, tested end to end

Each source below is validated end to end against a real fixture. Source drivers ship as optional extras — install only what you need.

Source Version tested Driver Install extra
Oracle 21c oracledb (thin) [oracle]
MySQL 8 PyMySQL [mysql]
PostgreSQL 14–16 psycopg core
SQL Server 2022 pyodbc + ODBC [mssql]

Targets: HeliosDB Nano, Lite, and Full; stock PostgreSQL 16; and MySQL 8 for migrate-back. PostgreSQL doubles as a source, so any-to-any moves — including HeliosDB → MySQL — run through the same engine. An Oracle-TNS-wire native target is experimental and not yet shipped.

Proven on real sample databases

Beyond synthetic fixtures, the engine is exercised against the canonical community sample databases for PostgreSQL and MySQL. Row counts are measured on representative fixtures — reproduce on your own and report variance.

Pagila — PostgreSQL

The headline real-data run. Pagila exercises timestamptz, arrays, composite primary keys, and declarative partitions across roughly 65k rows. All 13 sequences migrate with correct resume points and a working DEFAULT nextval. The live monitor demo ran on a 49,636-row Pagila load.

Sakila — MySQL

The view-translation corpus. Migrating Sakila from MySQL to stock PostgreSQL 16 translates all 8 views — GROUP_CONCATstring_agg, IF()CASE, loose → strict GROUP BY, backtick aliases. FK-index sanity is checked on film_category.

Fidelity fixture

A synthetic schema covering the awkward cases: boolean-ish flags, DECIMAL, large text and binary columns, NULL vs empty string, unicode, and embedded tabs and newlines. This is the round-trip fidelity test that gates a release.

Prove the migration, or fail the build

The validation suite returns a non-zero exit code on any mismatch, so it drops straight into CI. Run it after every load and after every cutover.

  • a2h test — object inventory and per-column diff between source and target.
  • a2h test-count — row-count parity, table by table.
  • a2h test-data — PK-ordered, per-row SHA-256 with cross-driver canonicalization, so a value compares equal regardless of which engine emitted it.
  • a2h test-index — FK-index sanity so foreign keys land on indexed columns.

Keep the target current during cutover

An Extract → trail → Replicat pipeline, GoldenGate in shape: a durable, append-only JSONL trail with an independent capture watermark and apply cursor.

  • a2h extract — Oracle SCN-watermark capture, or MySQL ROW-binlog capture including deletes.
  • a2h replicat — idempotent apply via INSERT … ON CONFLICT DO UPDATE, with optional delete reconciliation.
  • a2h extracts — list and inspect running captures.

CDC ships today for Oracle SCN-watermark and MySQL binlog sources.

Agent-Ready

Drive migrations from an AI agent

a2h mcp serve exposes 16 engine tools over MCP — assessment, export, load, validation, CDC — with Bearer-token auth and viewer / operator / admin RBAC, over both HTTP and stdio. Point Claude Code, Cursor, or any MCP client at it and let the agent plan and run the migration.

Install, connect, migrate

Shell
# Install with the source extras you need ([mysql] / [mssql] / [mcp] / [all])
pip install any2heliosdb[oracle]

# Connect both ends, smoke-test fidelity, write config.toml
a2h wizard

# Schema + parallel, resumable data load
a2h migrate    -c config.toml

# Watch it live (in another terminal)
a2h monitor    -c config.toml

# Validate — gates CI, non-zero exit on mismatch
a2h test-count -c config.toml && a2h test-data -c config.toml

How it moves data

A small set of well-separated parts, each replaceable.

Adapters → canonical IR

Per-dialect source adapters introspect schema and data into a single canonical intermediate representation. Pluggable target drivers emit from that IR to the destination, so adding an engine is additive.

Data-driven type map

Type mapping is data, not code paths — with global and per-column overrides and provenance. The runtime capability probe decides which write strategy the live target can actually use.

Chunked parallel load

Integer-PK-range chunking feeds a parallel worker pool. COPY fast path or array INSERT. Each chunk is idempotent — range-delete then load in one transaction — tracked in a durable SQLite-WAL manifest.

CDC trail

Change capture writes a durable, append-only JSONL trail with an independent capture watermark and apply cursor, so extract and apply can run and recover independently.

AI-native procedural migration is coming

Procedural code — stored procedures, packages, triggers — is the hardest part of any database migration. The next major version adds an optional AI-native path for it.

  • Pluggable LLM backend — a local Ollama model or any OpenAI-compatible endpoint, your choice.
  • It adapts PL/SQL to PL/pgSQL, then tests the result in an ephemeral, metadata-only sandbox before it lands.
  • Only working code is migrated; anything that fails the sandbox is flagged for review rather than silently shipped.

Planned for the next major release. Today, procedural objects are exported to a .review.sql companion for a human to port.

License
# Apache License 2.0
# Permissive, OSI-approved, no copyleft.

# Clean-room implementation — not derived
# from any GPL migration tooling.

# Use it commercially, embed it, fork it,
# wire it into your own pipelines.

git clone \
  https://github.com/HeliosDatabase/Any2HeliosDB

Migrate into HeliosDB, the open way

Any2HeliosDB is Apache 2.0 — a clean-room migration engine you can read, fork, and trust in production.