Skip to content
migration.tools

15 tools

Database migration

Convert schemas and data between MySQL, PostgreSQL, SQLite and SQL Server, generate ORM models from an existing database, and check that what arrived matches what left.

A workable order for a database migration

Convert the schema first and load it into an empty staging database. Schema problems — a type with no equivalent, an index that is too long, a default the target rejects — are cheap to fix before any data is involved.

Then move the data. For small and medium databases the converted INSERT statements are enough. For very large ones, use the target's bulk loader (COPY, LOAD DATA, bcp) with CSV exports, and keep the converted schema.

Finally, prove it. Compare row counts per table, then export a few critical tables from both sides and diff them by primary key with the CSV compare tool. Cut over only when the diff is empty or every difference is explained.

What automated conversion can't do

Stored procedures, triggers and functions are programs written in each database's own language. They need to be rewritten and tested by a person. The converters here pass them through untouched and flag them, rather than producing something that looks right and isn't.

Application queries matter as much as the schema: date arithmetic, string concatenation, case sensitivity in comparisons and GROUP BY strictness all differ between engines. Run your test suite against the new database before the switch.

Guides

Other categories