// Migrate MySQL to PostgreSQL

Migrate MySQL to PostgreSQL: the incompatibilities, the cutover, then support

To migrate MySQL to PostgreSQL, OSSeva assesses each application, converts the schema, rewrites the views, triggers and stored routines that loading tools leave behind, moves the data with pgloader or comparable tooling, runs old and new side by side, cuts over with a rollback plan and then supports the PostgreSQL cluster 24/7 on infrastructure you control. How long it takes depends on the number of schemas, the volume of stored code and MySQL-specific SQL in your applications, your data volume and the downtime window you can accept, so the assessment sets the dates. Moving is not always the better answer, and the assessment says so; a 15-minute discovery call starts it.

The plan
Assess each application, convert schema and code, run in parallel, cut over; then support
MySQL dates (endoflife.date)
5.7 ended 31 Oct 2023. 8.0 ended 30 Apr 2026. 8.4 LTS: Premier Support to 30 Apr 2029, ends 30 Apr 2032. 9.7 LTS ends 30 Apr 2034
Tools
pgloader for schema and data; Ora2Pg for assessment; AWS DMS for ongoing replication; DMS Schema Conversion for Aurora and RDS targets
What sets the timeline
Schema count, stored-code volume, MySQL-specific SQL in applications, data volume and the downtime window you can accept
While you migrate
MySQL 5.7 and 8.0 can stay patched: Critical CVEs (CVSS 9.0 or higher) within 48 hours, High within 7 days
Support hours
Assure includes 24/7 reactive support; Operate adds managed operations and a 15-minute P1 response

Dates checked on endoflife.date on 20 October 2026. Tool behaviour from the pgloader, Ora2Pg, mysql_fdw and AWS DMS documentation, the MySQL 8.4 Reference Manual and the PostgreSQL 18 manual, all fetched on 20 October 2026.

MySQL 5.7MySQL 8.0MySQL 8.4PostgreSQL 17PostgreSQL 18pgloaderOra2Pg

Only your email is required · An engineer replies within 1 business day · No commitment

Trusted globally by enterprises

NokiaSquareLittle CaesarsPanasonic ConnectPaylocity

How to convert MySQL to PostgreSQL: the incompatibility checklist

pgloader moves tables, data, indexes and foreign keys under casting rules, and its documentation lists views and triggers as not migrated. It describes no conversion of stored procedures, functions or events, and the SQL inside your applications is outside any loading tool. This checklist lists the MySQL constructs we check first, the PostgreSQL route for each, and what to test. It names risk areas, not a promise that each one occurs in your estate; the assessment finds which do.

MySQL constructPostgreSQL routeManual work and what to check
AUTO_INCREMENT columnsIdentity columns, or serial and bigserialpgloader's default casts turn auto_increment int columns into serial (precision below 10) or bigserial, and it resets sequences to the loaded maximum after the load. Replace LAST_INSERT_ID() calls with INSERT ... RETURNING, and decide whether new tables use identity columns instead of serial.
UNSIGNED integersThe next larger signed type, numeric, or a CHECK constraintPostgreSQL has no unsigned integer types. pgloader widens tinyint unsigned to smallint, smallint and mediumint unsigned to integer, and int unsigned to bigint. A bigint unsigned column needs a decision, because its range does not fit in bigint: numeric, or bigint with a CHECK.
TINYINT(1) and BIT(1)booleanpgloader casts both to boolean by default. The MySQL 8.4 manual says display width does not limit the stored range, so a TINYINT(1) column can hold values other than 0 and 1. Query the data before trusting the cast.
DATETIME, TIMESTAMP and zero datestimestamp or timestamptzMySQL converts TIMESTAMP values to UTC for storage and back to the session time zone, and stores DATETIME as written. pgloader casts both to timestamptz and turns zero-date defaults into NULL. Decide per column whether the value is an instant (timestamptz) or a wall-clock time (timestamp), and look for '0000-00-00' values, which the default sql_mode in MySQL 8.4 refuses on new inserts but older data can still hold.
ON UPDATE CURRENT_TIMESTAMPA BEFORE UPDATE triggerA PostgreSQL column has no such attribute, and pgloader's default casts drop the default on these columns, so the automatic modified-at behaviour is rebuilt as a trigger and tested.
ENUM columnsEnum types, text with a CHECK constraint, or a lookup tablepgloader creates an enum type named after the table and column for each ENUM column. Decide whether you want one type per column, shared types or lookup tables, and how the application's driver and ORM map them.
Case-insensitive collationsNondeterministic ICU collations, the citext extension or lower() indexesMySQL 8.4 defaults to utf8mb4_0900_ai_ci, which ignores case and accents, so lookups, unique keys and joins treat 'Smith' and 'smith' as equal. PostgreSQL's standard collations are deterministic, and its manual notes that nondeterministic collations cost performance and rule out some pattern matching operations. Choose per column, then recheck unique constraints, joins and LIKE queries.
Identifier case and quotingLower-case names, or quoted identifierspgloader lower-cases identifiers by default, except PostgreSQL keywords, and can quote them instead, which the application must then match. MySQL table-name case depends on the operating system and lower_case_table_names, so find code that relies on either. Backtick quoting has to go, and ANSI_QUOTES mode changes what double quotes mean.
|| and sql_modeThe string concatenation operatorIn MySQL, || means OR unless PIPES_AS_CONCAT is set; in PostgreSQL it always joins strings. Ora2Pg has a MYSQL_PIPES_AS_CONCAT directive for the case. Check each application's sql_mode and every query that uses ||.
GROUP BY under ONLY_FULL_GROUP_BYStricter grouping rulesThe default sql_mode in MySQL 8.4 includes ONLY_FULL_GROUP_BY, but sessions and older configurations can turn it off. PostgreSQL rejects non-aggregated columns that are not in GROUP BY or functionally dependent on it. Run the application's queries against PostgreSQL to find the ones that relied on a looser mode.
INSERT ... ON DUPLICATE KEY UPDATE, INSERT IGNORE, REPLACEINSERT ... ON CONFLICT DO UPDATE or DO NOTHINGThe PostgreSQL manual documents both ON CONFLICT actions, and each upsert names a unique index as its conflict target. REPLACE deletes and re-inserts, so it needs a deliberate rewrite. Test upserts under concurrent load.
GROUP_CONCATstring_aggThe PostgreSQL manual lists string_agg. MySQL cuts GROUP_CONCAT results off at group_concat_max_len, which is 1024 by default, so output that was silently truncated in MySQL now comes back whole.
LIMIT offset, countLIMIT count OFFSET offsetA mechanical rewrite of every query that uses the comma form. ORM dialect settings cover most of it; raw SQL does not.
Integer division, IFNULL, IF() and DATE_FORMATDivision with a cast, COALESCE, CASE and to_charIn MySQL, / on integers returns a decimal (the scale grows by div_precision_increment, 4 by default), while PostgreSQL truncates integer division toward zero. Search the code for / on integer columns and for MySQL-only functions; each needs a tested equivalent.
Views, triggers, stored procedures and functionsViews, triggers, and PL/pgSQL functions and procedures, rewrittenpgloader lists views and triggers as not migrated. It can load a view's rows as a table with MATERIALIZE VIEWS, which moves data and does not recreate the view. Routines are rewritten and tested against the same inputs.
Event Scheduler eventspg_cron or an external schedulerA MySQL event is a named object that runs SQL on a schedule, like a cron job. pg_cron is a cron-based job scheduler that runs inside PostgreSQL as an extension. pgloader's documentation describes no event migration, so inventory the events and re-create each one as a job.
JSON, FULLTEXT and spatial columnsjsonb, PostgreSQL full text search, and PostGISJSON columns map to the PostgreSQL json and jsonb types. Full text search in PostgreSQL uses tsvector and tsquery, so MATCH ... AGAINST queries are rewritten. pgloader's documented geometry coverage is the POINT type, so plan other spatial data separately.
Drivers, ORMs, poolers and replication toolingPostgreSQL drivers, PgBouncer and PatroniConnection strings, dialect settings and pooling change, and so does anything that reads the MySQL binary log: replicas, change-data-capture feeds and backups. No conversion tool sees this work; the connection inventory finds it.

Sources fetched 20 October 2026: the pgloader 3.6.10 MySQL documentation; the Ora2Pg README; the MySQL 8.4 Reference Manual (SQL modes, date and time types, default collation, numeric type attributes, identifier case sensitivity, INSERT ... ON DUPLICATE KEY UPDATE, GROUP_CONCAT, arithmetic operators, events); and the PostgreSQL 18 manual (INSERT, aggregate functions, collation support, lexical structure, mathematical functions, JSON types, enumerated types, text search) and the pg_cron README.

PostgreSQL vs MySQL: syntax, licensing and replication compared →MySQL 8.0 to 8.4 upgrade guide, if staying on MySQL is the better answer →

Why teams move from MySQL to PostgreSQL

Three reasons start most of these moves. Whether a move pays depends on your own estate, so this page states no figure; the database support cost calculator works from the numbers you enter.

A support date forces a decision

MySQL 8.0 community support ended on 30 April 2026, and 5.7 on 31 October 2023 (endoflife.date, checked 20 October 2026). The choice is an upgrade to 8.4 LTS, patched builds while you plan, or a different engine. The page on upgrading, switching or patching MySQL 8.0 sets the three side by side.

One engine across the estate

A team that already runs PostgreSQL elsewhere has one patch cycle, one high-availability design and one support contract to maintain, and a MySQL estate beside it doubles that. Consolidating is the usual reason to migrate rather than upgrade.

Applications you control can choose their database

If you own the application code, the database is a choice. If a vendor certifies its product only on MySQL, that application usually stays. The assessment gives a plain verdict per database: migrate, defer or stay.

The dates that matter

  1. 2023-10-31

    MySQL 5.7 reaches end of life.

  2. 2026-04-30

    MySQL 8.0 reaches end of life.

  3. 2029-04-30

    Oracle Premier Support for MySQL 8.4 LTS ends; Extended Support runs to 30 April 2032.

  4. 2029-11-08

    PostgreSQL 17 reaches community end of life.

  5. 2030-11-14

    PostgreSQL 18 reaches community end of life.

  6. 2032-04-30

    MySQL 8.4 LTS reaches end of life.

The phased plan to migrate MySQL to PostgreSQL

1

1. Assess and choose the destination

An inventory of schemas, views, triggers, stored routines, events, data volume and every client that connects. Ora2Pg's migration assessment report gives a first read of the schemas, and we add the application-side review it cannot see. For each database the plan says migrate, upgrade to MySQL 8.4 LTS, move to MariaDB, or stay, and why.

InventoryOra2Pg reportVerdict per database
2

2. Convert schema and code, and migrate the data

pgloader creates the tables, indexes, foreign keys and sequences in PostgreSQL under casting rules we write down with you. Views, triggers, routines and events are rewritten in SQL and PL/pgSQL. Loads are rehearsed with row counts and checksums compared on both sides.

pgloaderCasting rulesPL/pgSQLLoad rehearsals
3

3. Run in parallel

Applications, reports and scheduled jobs run against PostgreSQL alongside MySQL until the results match. The mysql_fdw extension can read MySQL tables from inside PostgreSQL to compare rows during this phase.

Side by sideReportsJobs
4

4. Cut over

A cutover runbook with a final sync, go and no-go checks and a rollback plan, run with your team in the change window. Sequences are reset to the loaded maximum, and the cluster moves into support the same day.

RunbookRollback planChange window

Which tool does which job

No tool converts everything. Schema and data move mostly by machine; the stored code, and the SQL in the applications that call it, is where the hours go.

Migration tools for MySQL to PostgreSQL

ToolWhat it doesWhat it leaves to you
pgloaderReads a MySQL database, creates the tables, indexes and foreign keys in PostgreSQL, loads the rows and resets sequences, with configurable casting rules. The simplest use is one command. Open source.Views and triggers, which its documentation lists as not migrated; stored routines and events, which it does not describe; geometry types other than POINT.
Ora2PgBest known for Oracle, its README also lists MySQL and MariaDB migration (it needs the DBD::MySQL Perl module), a migration assessment report, MySQL-specific directives such as MYSQL_PIPES_AS_CONCAT, and ora2pg_scanner for assessing many instances from a CSV list. Free software under GPL v3 or later.It is a first read and an export tool. Review its output and the application SQL by hand.
AWS DMSMoves data from MySQL, MariaDB and Aurora MySQL sources, and can replicate changes into a PostgreSQL target. Change capture needs binary logging on the source with binlog_format set to ROW.Schema conversion. Change capture does not support DROP TABLE or RENAME TABLE, and AWS documents that sequences are not migrated during ongoing replication, so update each sequence's value on the target after stopping replication.
AWS DMS Schema ConversionConverts MySQL schemas to Aurora PostgreSQL or RDS for PostgreSQL with a rules-based engine, and produces an assessment of what converts and what needs manual work.The data: it converts the schema, not the data. The MySQL path is not listed with generative AI conversion, and its targets are Aurora and RDS only.
mysql_fdwA PostgreSQL extension from EnterpriseDB that exposes MySQL tables as foreign tables, with write support and IMPORT FOREIGN SCHEMA; the README lists PostgreSQL 14 to 19. Ora2Pg can export table definitions for it. Useful for comparing rows during the parallel run.It is a bridge, not a migration: queries through it still run on MySQL, so it is not a way to leave.

From the pgloader 3.6.10 MySQL documentation, the Ora2Pg README, the AWS DMS user guide pages on MySQL sources, PostgreSQL targets and DMS Schema Conversion, and the mysql_fdw README, fetched 20 October 2026.

Keep MySQL patched while the migration runs

A migration is a project, and the MySQL servers keep running through it. OSSeva supports self-managed MySQL Community Edition 5.7 and 8.0 with patched builds after Oracle's end of life, and 8.4 and 9.7 LTS, so the old servers are not an unpatched risk while the new cluster is built and rehearsed. The same contract then covers the PostgreSQL cluster.

If MySQL works for you and the goal is a supported version, upgrading to 8.4 LTS is usually less work than a change of engine, and the assessment will say so.

Support after cutover

The new cluster moves into OSSeva support on the day of cutover, wherever it runs: your servers, VMs, Kubernetes or cloud account. The team that moved your data is the team that answers the pager, and Assure includes 24/7 reactive support.

Support tiers for the PostgreSQL cluster you land on

TierWhat it addsResponse and patch terms
PatchSigned PostgreSQL builds with backported security fixes once your major version passes community end of life (17 on 8 November 2029, 18 on 14 November 2030).Critical CVEs (CVSS 9.0 or higher) patched within 48 hours, High within 7 days.
AssureEverything in Patch, plus major-version migration planning, a performance and vacuum configuration audit, a compliance attestation package and 24/7 reactive support.24/7 reactive support.
OperateEverything in Assure, plus managed operations: replication and failover monitoring, Patroni, repmgr and quorum monitoring, vacuum and analyze tuning, point-in-time recovery testing and quarterly capacity reviews.15-minute P1 incident response.

Tier contents from the OSSeva PostgreSQL technology page. Support is priced per cluster; the discovery call gives the quote. PostgreSQL end-of-life dates from endoflife.date, checked 20 October 2026.

How do the ways of moving off MySQL compare?

OptionWhat you getTrade-off
Stay on MySQL and upgrade to 8.4 LTSNo change of engine, on an LTS line with Oracle Premier Support to April 2029Authentication and replication changes to test. If PostgreSQL features are not the reason to move, this is often the better choice.
Move to MariaDBA MySQL-compatible open-source engine on long-term linesFrom MySQL 8.0 it is a dump and load with compatibility testing, and it is still a different engine.
Aurora or RDS for PostgreSQLA hosted target, with AWS DMS for data and DMS Schema Conversion for the schemaThe database stays on that provider's service and version calendar, and the stored code still needs a rewrite.
Do it yourself with pgloader and Ora2PgFree open-source tools and full controlYour team carries the code rewrite, the cutover and running PostgreSQL afterwards.
OSSeva migration and supportOne team from assessment through cutover, then PostgreSQL support on your own infrastructureA services engagement followed by a subscription, priced per cluster.

Tool behaviour from the pgloader 3.6.10 MySQL reference, the Ora2Pg README, the mysql_fdw README, the AWS DMS user guide, the MySQL 8.4 Reference Manual and the PostgreSQL 18 manual, fetched on 20 October 2026. MySQL and PostgreSQL dates from endoflife.date, checked on 20 October 2026. OSSeva coverage from the OSSeva PostgreSQL and MySQL technology pages. Savings depend on your own estate; the calculator uses your inputs and no assumed figures.

Questions

Frequently asked questions

Book a 15-minute call

How to change MySQL to PostgreSQL?

In four steps. Assess the schemas and the applications that connect. Convert the schema and load the data with a tool such as pgloader, and rewrite the views, triggers and stored routines it does not carry across. Run both systems side by side until results match. Then cut over with a rollback plan. The parallel run is where most surprises show up, and the checklist near the top of this page lists the constructs we check first.

Is Postgres harder than MySQL?

Not harder, but stricter and different. PostgreSQL is less forgiving about types, grouping and case, so SQL that MySQL accepted can fail until it is corrected. Operating it also means learning its own routines, such as vacuum, connection pooling and a high-availability setup like Patroni. That operations gap is the reason the support after cutover is part of the offer.

How do I convert MySQL to PostgreSQL?

Convert in two layers. The schema and data convert mostly by machine: pgloader creates the tables, indexes and foreign keys and loads the rows under casting rules you can override. The code converts by hand: views, triggers, stored routines, events and the MySQL-specific SQL in your applications. The second layer sets the pace.

What is the best tool for MySQL to PostgreSQL data migration?

pgloader is the usual choice for data: one command reads a MySQL database, creates the tables in PostgreSQL, loads the rows and builds the indexes. Ora2Pg also accepts MySQL and MariaDB as a source and adds an assessment report. AWS DMS can replicate changes into a PostgreSQL target when the downtime window is short. All three are used together rather than as alternatives.

Does pgloader migrate views and triggers?

No. Its documentation lists views and triggers as not migrated, and of the geometric types only POINT is covered. It can read a MySQL view as if it were a table, which moves the data but does not recreate the view.

Can ora2pg migrate MySQL to PostgreSQL?

Yes, as a first read and an export. Ora2Pg is best known for Oracle, but its README lists MySQL and MariaDB as sources, with an assessment report and MySQL-specific settings such as MYSQL_PIPES_AS_CONCAT. Review its output by hand.

Can AWS DMS migrate MySQL to PostgreSQL?

AWS DMS moves the data, from MySQL, MariaDB or Aurora MySQL sources into a PostgreSQL target, and DMS Schema Conversion converts the schema for Aurora PostgreSQL and RDS for PostgreSQL. Change capture needs binary logging in ROW format on the source, and AWS documents that sequences are not migrated during ongoing replication, so they are reset at cutover.

Do we have to leave MySQL now that 8.0 has ended?

No. You can upgrade to 8.4 LTS, stay on 8.0 with patched builds while you plan, or switch engine. A migration to PostgreSQL pays when PostgreSQL features matter to you or you want one engine across the estate. The page on upgrading, switching or patching MySQL 8.0 compares the three routes.

What decides how long a MySQL to PostgreSQL migration takes?

The number of schemas, the volume of stored code, the MySQL-specific SQL in your applications, the data volume, and the downtime window you can accept. We do not quote a duration in advance; the assessment turns those inputs into a plan, and the plan carries the dates.

Can OSSeva support MySQL while we migrate?

Yes. MySQL 5.7 and 8.0 get patched builds after Oracle's end of life, and 8.4 and 9.7 LTS are supported, under the same contract as the new PostgreSQL cluster.

Who supports PostgreSQL after the migration?

OSSeva. The new cluster moves into support on the day of cutover. Patch delivers signed builds, Assure adds 24/7 reactive support and upgrade planning, and Operate adds managed operations with a 15-minute P1 response.

How is it priced?

The migration is a services engagement and the support afterwards is priced per cluster. A 15-minute discovery call gives you a quote, and the database support cost calculator works from your own figures.

Who is this for?

Teams moving MySQL databases behind their own applications to PostgreSQL they run themselves, who want the migration and the support afterwards from one team.

Get a quote

Migrate MySQL to PostgreSQL with the team that supports it afterwards.

Book a 15-minute discovery call. The written assessment follows, and support is priced per cluster.

Only your email is required · An engineer replies within 1 business day · No commitment

Prefer to talk or read more first?

Book a call