credativ-pg-migrator

Migrate legacy databases to PostgreSQL
credativ-pg-migrator moves schemas, data, constraints, routines and views from proprietary and legacy database systems into PostgreSQL — with a migration protocol and post-migration verification that tell you exactly what arrived.
Why credativ-pg-migrator#
Ten source databases, one tool
Oracle, Informix, Sybase ASE, MS SQL Server, IBM DB2 (LUW, z/OS, i), MySQL, MariaDB, SQL Anywhere, SQLite and PostgreSQL — each behind its own connector, so engine quirks are handled where they belong.
More than tables and rows
Primary keys, secondary indexes, foreign keys, check constraints, defaults, identity columns and sequences migrate along with the data. Views, functions, procedures and triggers are transpiled to PostgreSQL SQL and PL/pgSQL.
Verified, not just copied
Post-migration validation runs independent parity checks — row counts, full-table checksums, random row hashes and LOB byte sizes — plus structural comparison of columns, indexes and constraints, reported in a Markdown summary.
Built for restricted environments
Where a live connection is not an option, the migrator ingests offline DDL scripts and
CSV extracts (IBM DB2 z/OS and i) or Informix .unl export files instead.
Customisable by configuration
A single YAML file drives the run: data type substitutions, default value replacements,
per-table WHERE filters, batch sizes and conflict resolution — no code changes
needed to adapt to your schema.
A full migration protocol
Every migrated object is recorded in a PostgreSQL migration database with its source code, generated target code and outcome — so a failed object can be inspected and retried rather than guessed at.
Supported source databases#
- Oraclelive connection
- Informixlive connection
- Sybase ASElive connection
- MS SQL Serverlive connection
- IBM DB2 LUWlive connection
- IBM DB2 z/OSoffline (DDL + CSV)
- IBM DB2 for ioffline (DDL + CSV)
- MySQLlive connection
- MariaDBlive connection
- SQL Anywherelive connection
- SQLitelocal file, no driver
- PostgreSQLspecial use cases
How complete each connector is differs considerably. The feature matrix lists the per-connector, per-feature status — reconciled against the connector sources, not against a roadmap.
Target database: PostgreSQL.
Installation#
From PyPI#
python3 -m venv migrator_venv
. ./migrator_venv/bin/activate
pip install credativ-pg-migratorThe package is published at pypi.org/project/credativ-pg-migrator.
From the PostgreSQL APT repository#
credativ-pg-migrator is included in the apt.postgresql.org PostgreSQL community
repository — see the PostgreSQL APT wiki page
for how to enable it on Debian and Ubuntu.
Running a migration#
credativ-pg-migrator \
--config=./test_database.yaml \
--log-file=./test_database_$(date +%Y%m%d).log \
--log-level=INFOReady-to-use configuration examples for every supported source database are in
docs/configs/
in the repository — copy the one matching your source, adjust the lines marked
>>> ADJUST, and run it.
Architecture#

The tool connects to the source database, introspects the data model, generates PostgreSQL-compatible structures and writes them into the target — coordinated by a central orchestrator running parallel workers. Read more on the documentation page.
Open source, with professional support#
credativ-pg-migrator is released under the
GNU General Public License v3
and developed in the open on GitHub. It is built and maintained by
credativ GmbH, a PostgreSQL and open source consulting and
engineering company.
If you are planning a database migration and want professional support — from an assessment of your source system to running the migration itself — please get in touch with credativ.
Get involved#
Bug reports, feature requests and pull requests are welcome. Whether you have a source database whose connector needs improvement or a conversion edge case that fails, an issue on GitHub is the right place to start. See Get Involved for details.