mysql_migrator
is a plugin for db_migrator
that uses
mysql_fdw
to migrate an MySQL or MariaDB database to PostgreSQL.
-
You need PostgreSQL 10 or later.
-
The
mysql_fdw
anddb_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.
The db_migrator
callback function db_migrator_callback()
returns the
migration functions provided by the extension.
See the db_migrator
documentation for details.
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
(defaultpgsql_stage
): The name of the PostgreSQL stage created bydb_migrate_prepare()