Skip to content

fljdin/mysql_migrator

Repository files navigation

MySQL/MariaDB to PostgreSQL migration tools

mysql_migrator is a plugin for db_migrator that uses mysql_fdw to migrate an MySQL or MariaDB database to PostgreSQL.

Prerequisites

  • You need PostgreSQL 10 or later.

  • The mysql_fdw and db_migrator extensions must be installed.

  • A foreign server must be defined for the MySQL database you want to access.

  • A user mapping must exist for the user who calls the db_migrate function.

Objects created by the extension

Migration functions

The db_migrator callback function db_migrator_callback() returns the migration functions provided by the extension. See the db_migrator documentation for details.

function mysql_migrate_identity

Its read tables, columns, keys and sequences staging tables to correctly map primary key columns with MySQL's AUTO_INCREMENT attribute, in order to define identity specifications per column.

This function must be executed before db_migrate_finish(), as it replaces pre-existent sequences based on data in staging schema.

The function parameters are:

  • pgstage_schema (default pgsql_stage): The name of the PostgreSQL stage created by db_migrate_prepare()

About

Tools for MySQL to PostgreSQL migration

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published