Skip to content

MariaDB to PostgreSQL

MariaDB to PostgreSQL migration

Last updated:

Datalobe treats MariaDB as its own source, not as MySQL: it assesses the source, converts stored procedures, functions, triggers and views, compiles each on PostgreSQL before deploy, moves data with change data capture (CDC) until cut-over, and validates every table with 17 checks.

MariaDB to PostgreSQL

Source

  • MariaDB
Code
Stored routines

Target

  • PostgreSQL
Code
PL/pgSQL

Conversion

What converts automatically, and what needs review?

Stored procedures, functions, triggers and views convert to PL/pgSQL, and tables, types and keys follow fixed rules.

AI converts stored code, every AI conversion is checked, and anything that cannot be proven goes to a named person.

Every converted statement is compile-checked on PostgreSQL before deploy: Datalobe replays it inside a transaction that is rolled back.

Assessment

Which differences does the assessment look for?

Where a choice is needed, such as zero dates, a named approver decides before the run.

MariaDB features and their common PostgreSQL equivalents
MariaDBCommon PostgreSQL equivalent
AUTO_INCREMENTIdentity column (GENERATED AS IDENTITY)
TINYINT(1) used as a flagBOOLEAN, by decision
UNSIGNED integer typesA larger signed type or a check constraint
ENUMAn enum type or a check constraint
Zero dates such as '0000-00-00'Not valid; NULL or a chosen date, by decision
ON UPDATE CURRENT_TIMESTAMPA trigger
Case-insensitive default collationCase-sensitive comparison by default

Validation

What is validated, and how?

17 checks on every table in six groups, and code computes one verdict: Passed, Passed with warnings, Not verified or Failed.

Validation groups on a MariaDB to PostgreSQL migration
GroupWhat it checks on a MariaDB to PostgreSQL migration
CompletenessRow counts match on every table, and every object is present
AccuracyChecksums by chunk on all rows, and sample rows compared value by value
StructureColumns, types and defaults match the plan, and AUTO_INCREMENT and identity values are reset
IntegrityPrimary key, foreign key, unique and check constraints hold on PostgreSQL
Code objectsConverted routines and views are present and compiled, deterministic read-only functions return the same results on both sides, and triggers are present and enabled
Performance readiness (advisory)Indexes are built and statistics analysed. Advisory, not part of the verdict

Questions

Frequently asked questions

Is migrating MariaDB the same as migrating MySQL?

Mostly. MariaDB shares much of its history with MySQL but the two have drifted apart, and some MariaDB features need their own handling, so Datalobe treats MariaDB as its own source.

Do MariaDB stored procedures convert to PostgreSQL?

Yes. AI converts stored code, every AI conversion is checked, and anything that cannot be proven goes to a named person. Each one must compile on PostgreSQL before deploy.

How much downtime does the migration need?

With keep-in-sync (CDC), downtime is limited to the cut-over window. CDC keeps PostgreSQL in sync while MariaDB stays in use, and data copies in checkpointed batches that resume after an interruption.

Sources (26)

Next step

Assess your MariaDB database

Send a read-only connection or a schema export and get an Assessment Report.