Skip to content

About

Database Migration Studio: Open-source database migration tools for MySQL, PostgreSQL & SQLite. Pre-flight compatibility analyzer, migration planner & SHA-256 verifier.

Topics

Resources

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

Database Migration Tools: Database Migration Studio

CI Deploy Pages License: MIT Interactive Analyzer

Database Migration Studio (dbmigrate) is an open-source database migration tool for macOS, Windows, and Linux built with Rust, Tauri v2, React, and TypeScript. It inspects source and target schemas, flags dialect incompatibilities upfront, builds a versioned migration plan, transfers data with Primary Key checkpoints, and verifies results with SHA-256 table checksums.

Try the interactive browser Migration Readiness Analyzer at https://sql-devops.github.io/database-migration-tools/ (runs directly in your browser on pasted or uploaded SQL DDL schemas).

Database Migration Studio 5-screen workbench

How Database Migration Studio Works

The workflow follows five explicit stages:

Source -> Analyze -> Migration Plan -> Transfer -> Verification

  1. Source & Target Inspection: Opens the source database in read-only mode, gathers server versions, collations, privileges, and object counts, and refuses writes into non-empty target databases by default.
  2. Compatibility Analysis: Flags BLOCKER, ACTION REQUIRED, and WARNING findings before touching data. Unrecognized column types block migration instead of coercing data silently, and unmigrated objects (views, triggers, stored routines) are listed explicitly.
  3. Migration Plan (plan.json): Topologically orders tables by foreign key dependencies, applies type mappings and table or column renames, previews target DDL, and strips all connection passwords.
  4. Resumable Data Transfer: Streams batches, applies deterministic type conversions (DECIMAL(20,8) exact strings, TINYINT(1) booleans, zero-date policies, JSON to JSONB), builds secondary indexes and foreign keys in Stage 6, and synchronizes sequences in Stage 7.
  5. Post-Transfer Verification & Reports: Checks 9 mandatory invariants, compares normalized SHA-256 checksums, verifies Primary Key row samples, confirms source fingerprint invariance, and exports self-contained HTML and JSON reports.

Supported Migration Directions

Source Target Priority Status Notes
MySQL / MariaDB PostgreSQL P0 Supported Handles UNSIGNED, TINYINT(1), DATETIME, DECIMAL(20,8), JSON, ENUM, zero dates
PostgreSQL PostgreSQL P1 Supported Cross-version upgrades, cloud targets, pgcopydb command export
MySQL MySQL P1 Supported Collation inspection, single-transaction snapshot, PK checkpointing
SQLite PostgreSQL P1 Supported Direct sqlite_master and PRAGMA inspection, identity sync
CSV / SQL Dump MySQL / PostgreSQL P2 Experimental DDL + INSERT fixture ingestion
SQLite MySQL P2 Planned Roadmap Milestone 3
PostgreSQL MySQL P2 Planned Roadmap Milestone 3
SQL Server PostgreSQL / MySQL P2 / P3 Planned Roadmap Milestone 3
Oracle PostgreSQL P3 Planned Roadmap Milestone 3

Works with Self-Hosted, AWS RDS / Aurora, Google Cloud SQL, Azure Database, Supabase, Neon, and Railway environments (reporting managed free disk space honestly as Unknown when host telemetry is unavailable).

Feature Maturity Matrix

Capability Status Details
Pre-flight Compatibility Analyzer Supported Detects missing PKs, zero dates, UNSIGNED, DECIMAL, JSON, triggers, views, privileges
Read-only Source & Empty-Target Guard Supported Zero automatic DROP or TRUNCATE; source opened read-only
Secret-Free Plans & Reports Supported Passwords excluded from plan.json, report.json, report.html, and logs
Safe PK Checkpointed Resume Supported Keyset resume (WHERE pk > last_pk); blocks unsafe append on PK-less tables
9-Point Verification + SHA-256 Digests Supported Checks row counts, checksums, PK samples, sequences, and source invariance
pgloader & pgcopydb Script Export Supported Generates inspectable external bulk loader configurations
Live Schema Diff & Git DDL Rollouts Planned Scoped for Milestone 4 (Roadmap)
CDC / Minimal-Downtime Cutover Planned Scoped for Milestone 5 (Roadmap)

Comparison With Existing Tools

Capability Database Migration Studio pgloader pgcopydb AWS DMS Flyway / Liquibase DBeaver
Pre-flight Compatibility Analyzer Yes (BLOCKER / ACTION / WARN) Runtime errors Minimal Pre-migration assessment Schema changesets only Manual
Cross-Engine Data Transfer Yes PostgreSQL target only PostgreSQL only Cloud only No Basic GUI export
Normalized SHA-256 Verification Yes (9 mandatory checks) Row counts only Row/byte counts Validation tasks History checksums Manual
Resumable PK Checkpointing Yes (WHERE pk > last_pk) Partial Yes CDC tasks No No
Runs Locally (Desktop + CLI, MIT) Yes (Zero Docker required) Yes (PostgreSQL License) Yes (PostgreSQL License) No (AWS lock-in) OSS + Paid Pro Community + Pro

Real Example: MySQL to PostgreSQL End-to-End Run

Run the built-in end-to-end demonstration directly from the CLI:

cargo run -- demo --dir ./demo-run

Or run the five individual CLI stages step by step:

dbmigrate analyze --config ./demo-run/migration.yaml
dbmigrate plan    --config ./demo-run/migration.yaml --output ./demo-run/plan.json
dbmigrate run     --plan ./demo-run/plan.json --config ./demo-run/migration.yaml --job-id cli-demo-01
dbmigrate verify  --job cli-demo-01
dbmigrate report  --job cli-demo-01 --format html --output ./demo-run/report.html

Observed output from dbmigrate analyze and dbmigrate verify on the 3-table MySQL sample (users, products, orders, plus v_active_users and trigger_update_balance):

Analysis: MySQL -> PostgreSQL
  Tables found:          3
  Estimated volume:      448 bytes (7 rows)
  Simple tables:         0
  Require conversion:    3
  Require manual review: 0
  Blockers / Actions / Warnings: 0 / 9 / 4
  - [ActionRequired] users.id: users.id: INT UNSIGNED -> BIGINT
  - [ActionRequired] users.is_active: users.is_active: TINYINT(1) -> BOOLEAN
  - [ActionRequired] users.created_at: users.created_at: MySQL DATETIME -> PostgreSQL TIMESTAMPTZ
  - [ActionRequired] products.id: products.id: AUTO_INCREMENT -> IDENTITY + sequence sync
  - [ActionRequired] products.metadata: products.metadata: JSON -> JSONB
  - [ActionRequired] orders.user_id: orders.user_id: INT UNSIGNED -> BIGINT
  - [ActionRequired] orders.price: orders.price: DECIMAL(20, 8) -> NUMERIC(20, 8)
  - [ActionRequired] orders.ordered_at: orders.ordered_at: MySQL DATETIME -> PostgreSQL TIMESTAMPTZ
  - [ActionRequired] trigger_update_balance: Trigger 'trigger_update_balance' is not automatically migrated
  - [Warning] shop_prod: Collation difference: utf8mb4_0900_ai_ci vs en_US.UTF-8
  - [Warning] shop_pg: AWS RDS / Aurora environment check
  - [Warning] shop_pg: Target free disk space: Unknown
  - [Warning] v_active_users: View 'v_active_users' requires manual dialect review

Verification for job cli-demo-01: SUCCESS WITH WARNINGS
  [PASS] Migrated table count: 3/3 planned tables present in target
  [PASS] Expected columns present: All expected columns found in target
  [PASS] Data types and constraints: Target column types match approved migration plan
  [PASS] Row counts and normalized checksums: All 3 table(s) matched row counts, SHA-256 checksums, and PK samples
  [PASS] Primary and Foreign Keys: Primary keys and foreign key metadata match plan
  [PASS] Indexes: All planned indexes created
  [PASS] Sequences and identity counters: Auto-increment/identity sequences synchronized
  [PASS] Load error check and read-only source integrity: Zero load errors; source database fingerprint unchanged
  [PASS] Unmigrated objects audit: 2 non-table object(s) documented for manual review: VIEW v_active_users, TRIGGER trigger_update_balance

Migration Readiness Analyzer compatibility report

Installation and Local Build

Prerequisites

  • Rust 1.80+ (cargo, rustc)
  • Node.js 20+ (for the Desktop UI, Web Analyzer, and SEO docs)

Build CLI and Run Automated Tests

git clone https://github.com/sql-devops/database-migration-tools.git
cd database-migration-tools

# Run all 14 Rust integration test scenarios and release gates
cargo test

# Run browser analyzer unit tests and build web bundle
npm install
npm test
npm run build

Run Desktop Application (Tauri v2)

npm run tauri dev

Build native packages (.app/.dmg, .msi, .AppImage):

npm run tauri build

CLI Command Reference

# Inspect source and target databases and emit diagnostics JSON
dbmigrate analyze --config migration.yaml --output analysis.json --json

# Build a secret-free versioned migration plan
dbmigrate plan --config migration.yaml --output plan.json

# Execute migration (read passwords from DBMIGRATE_SOURCE_PASSWORD / DBMIGRATE_TARGET_PASSWORD)
dbmigrate run --plan plan.json --job-id prod-001

# Resume an interrupted job safely at the last committed PK checkpoint
dbmigrate run --plan plan.json --resume-job prod-001

# Re-run 9-point verification and export HTML or JSON report
dbmigrate verify --job prod-001
dbmigrate report --job prod-001 --format html --output report.html

Known Limitations

  • Procedural objects: Views, triggers, stored procedures, and user-defined functions are detected and listed under Unmigrated Objects instead of being translated automatically across dialects.
  • Browser analyzer scope: The GitHub Pages web analyzer parses pasted or uploaded SQL DDL schemas locally inside the browser and never claims to inspect a live server without a Desktop or CLI connection.
  • Non-empty targets: Overwriting existing rows or dropping production tables is disabled by default; target databases must be empty or explicitly isolated.
  • PK-less tables: Tables without Primary Keys cannot resume in-place after an interrupted transfer and require a fresh isolated reload.

Frequently Asked Questions

How do I verify a MySQL to PostgreSQL migration beyond row counts?

Database Migration Studio compares row counts, normalized SHA-256 table checksums (distinguishing NULL from empty strings and checking exact decimal string representations), sampled Primary Key rows, synchronized identity sequences, and source fingerprint invariance before and after transfer.

Does the tool modify my source database?

No. Source adapters open in read-only mode during inspection, execution, and verification, and the final verification report compares the source schema and row-count fingerprint before and after migration.

What is the difference between Database Migration Studio and Flyway or Liquibase?

Flyway and Liquibase manage versioned incremental schema changesets as an application evolves. Database Migration Studio analyzes cross-engine compatibility, transfers schema and bulk data into a new target database, and verifies data integrity across engines.

Guides and Documentation

License

MIT License

About

Database Migration Studio: Open-source database migration tools for MySQL, PostgreSQL & SQLite. Pre-flight compatibility analyzer, migration planner & SHA-256 verifier.

Topics

Resources

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages