Skip to content

pgferry

Migrate MySQL, MariaDB, SQLite, or MSSQL databases to PostgreSQL with a plan-first workflow, copy-pasteable configs, and explicit handling for the messy parts.

CI-tested sources

MySQL 5.7, 8.0 and latestMariaDB 10.6 and latestSQLiteMSSQL 2017, 2019, 2022, and 2025

Real migrations, no surprises

Introspects your source schema, creates matching PostgreSQL tables, and streams data, then adds keys, indexes, foreign keys, sequences, and triggers after the load.

For most migrations, that covers the entire pipeline end to end. When something can’t be migrated automatically, views, routines, generated-column expressions, or unsupported index types, pgferry plan tells you before any data is touched.

Both are a single config file. Fast is great for dev iterations and works fine for production when you can afford to re-run from scratch. Safe adds crash recovery and validation for when you cannot.

Fast

schema = "app"
on_schema_exists = "recreate"
[source]
type = "mysql"
dsn = "root:root@tcp(127.0.0.1:3306)/source_db"
[target]
dsn = "postgres://…/target_db?sslmode=disable"

Drops the target schema, skips WAL logging, and optimizes for speed. Ideal for disposable dev or staging targets you rebuild often.

Safe

schema = "app"
on_schema_exists = "error"
unlogged_tables = false
resume = true
validation = "row_count"
[source]
type = "mysql"
dsn = "root:root@tcp(127.0.0.1:3306)/source_db"
[target]
dsn = "postgres://…/target_db?sslmode=disable"

Refuses to overwrite existing schemas, keeps WAL logging for crash safety, checkpoints progress, and validates row counts after the load.

  • No runtime dependencies or extra tooling to install.
  • Interactive pgferry wizard that can generate, plan, and start a migration in one flow.
  • Fast parallel COPY loads with range-based chunking for large tables.
  • Clear stage and row-copy progress logs, so long runs do not look frozen.
  • Preflight plan reports views, routines, triggers, generated columns, skipped indexes, semantic-drift warnings, orphan-cleanup candidates, required extensions, collation warnings, and copy-risk ETA ranges before PostgreSQL is touched.
  • Resumable chunked migrations, so failures do not send you back to zero.
  • Consistent-snapshot mode for migrating live source databases safely.
  • Built for messy real-world schemas with hooks, orphan cleanup, generated-column reporting, and unsupported-index warnings.
  • schema_only and data_only runs when you need tighter control.
  • Extension-backed features like citext and PostGIS, with validation and optional auto-create.
  • Post-load validation modes that range from fast row_count checks to stronger bounded sampled_hash content checks.