A MySQL/SQLite-to-PostgreSQL migration CLI. Single binary, zero runtime dependencies.
Reads your source schema, creates matching PostgreSQL tables, streams data in parallel via COPY, then wires up constraints, indexes, sequences, and (optionally) triggers.
| Source | Driver | Workers | Snapshot mode |
|---|---|---|---|
| MySQL | go-sql-driver/mysql |
Parallel (configurable) | none, single_tx |
| SQLite | modernc.org/sqlite (pure Go) |
Sequential (1 worker) | none only |
Download the latest binary from the GitHub Releases page, or:
go install github.com/Limetric/pgferry@latestMySQL → PostgreSQL
schema = "app"
[source]
type = "mysql"
dsn = "root:root@tcp(127.0.0.1:3306)/source_db"
[target]
dsn = "postgres://postgres:postgres@127.0.0.1:5432/target_db?sslmode=disable"SQLite → PostgreSQL
schema = "app"
[source]
type = "sqlite"
dsn = "/path/to/database.db"
[target]
dsn = "postgres://postgres:postgres@127.0.0.1:5432/target_db?sslmode=disable"Run:
pgferry migration.tomlpgferry will introspect the source, create tables under the app schema, stream all data,
then add primary keys, indexes, foreign keys, and auto-increment sequences.
pgloader is a great tool. pgferry aims to be simpler and more robust out of the box — native MySQL 8.4+ auth, a single TOML config instead of a custom DSL, flexible type mapping coercions, charset/collation awareness, SQL hooks, configurable orphan cleanup, and SQLite support.
We also maintain a pgloader fork that patches common upstream issues.
The examples/ directory has ready-to-use configs:
minimal-safe,
recreate-fast,
hooks,
sakila,
schema-only,
data-only.
- Configuration — all TOML settings, defaults, validation
- Type mapping — source→PG type tables, coercion options
- Migration pipeline — step-by-step pipeline, modes, snapshots
- Hooks — 4-phase SQL hook system, templating
- Conventions & limitations — naming, orphan cleanup, unsupported features
Apache 2.0 — see LICENSE.