Migrate from MySQL to PostgreSQL: what the move involves and what drives the effort
A MySQL or MariaDB move to PostgreSQL is a schema and data conversion plus application query work, and the effort depends on three things: how much of the SQL dialect your application uses, how much logic lives in stored code, and how much downtime the business will accept at cutover. Teams that treat it as a simple dump and load usually discover the cost late, in queries that fail at runtime, triggers that behave differently and data that is rejected by stricter types. PostgreSQL is released under the PostgreSQL License, a liberal open source license similar to the BSD or MIT licenses, so the target database carries no license fee, but the engineering work is still yours to plan, fund and staff. This page covers the documented open-source tools for the job, pgloader and Ora2Pg, and the decisions around them.
Start by inventorying what the source actually does. Count tables, views, stored procedures, functions, triggers and events, and list every database-side feature in use, including AUTO_INCREMENT columns, ENUM and SET types, TINYINT(1) booleans, zero dates, full-text indexes, and character sets such as utf8mb3 versus utf8mb4. Each of these maps differently in PostgreSQL, and each adds review time. Pull query logs or the application's SQL inventory and mark statements that use LIMIT with non-standard syntax, GROUP BY without strict column rules, string functions specific to MySQL, or implicit type coercion. Those statements are where application changes concentrate, and they drive the size of the test effort more than table count does.
Downtime tolerance is the decision that sets the cutover design. An offline load of a small schema can fit a maintenance window, while a larger or always-on system will need a plan to replicate changes until the switch. Ask your team and your application owners to write down the acceptable downtime, the rollback trigger and who approves the cutover before the tool is chosen. Confirm what the target environment must provide, including the PostgreSQL version you will run (the supported versions are listed in the PostgreSQL versioning policy), backup coverage and monitoring, because those costs recur after the migration is finished.
Which MySQL features map to PostgreSQL and which need rework
This table compares common MySQL and MariaDB features with their PostgreSQL equivalents and notes what changes during migration. Read the last column first for each row, since it names the work that usually lands on the application team or the migration team. Where behavior differs in subtle ways, the table says to test rather than assume equivalence.
| MySQL or MariaDB feature | PostgreSQL equivalent | Migration notes |
|---|---|---|
| Integer types and UNSIGNED | smallint, integer, bigint; no unsigned types | Widen unsigned columns to the next larger signed type or add CHECK constraints. Confirm the largest stored values fit. |
| AUTO_INCREMENT | identity columns or sequences | Reset sequences to the maximum loaded value after data load. Otherwise the first inserts after cutover can fail on duplicate keys. |
| String types and character sets | text, varchar, char with database encoding | Confirm the source charset is utf8mb4 and map it to UTF8 encoding. Trailing-space handling in CHAR columns can differ, so test comparisons. |
| ENUM | enum type or text with CHECK constraint | Native enums are harder to alter later. Choose one approach per table and test how application writes handle invalid values. |
| SET type | No direct equivalent; use text[] or a join table | Expect application query changes. Functions such as FIND_IN_SET must be rewritten. |
| DATETIME and TIMESTAMP | timestamp without time zone, timestamp with time zone | TIMESTAMP in MySQL converts with session time zone and has a 2038 range limit. Zero dates such as 0000-00-00 are invalid in PostgreSQL and must be cleaned or mapped to NULL before load. Test every conversion. |
| JSON | json and jsonb | Operators and path functions differ. jsonb is usually the better fit for indexing. Test queries that rely on MySQL path syntax. |
| Full-text search | tsvector with GIN indexes | MATCH AGAINST queries and relevance scoring need rewriting. Compare result ranking with business users before cutover. |
| Stored procedures and triggers | PL/pgSQL functions and triggers | Procedural code is rewritten by hand. Implicit type conversions that MySQL allows are often errors in PostgreSQL, so each routine needs its own test cases. |
| Storage engines (InnoDB, MyISAM) | Single heap storage with MVCC | MyISAM has no transactions, so data it held may have integrity problems to check. MySQL engine clauses are dropped during conversion. |
| sql_mode settings | Strict typing by default | Applications that depended on permissive modes such as ALLOW_INVALID_DATES or implicit truncation may fail. Record the active sql_mode before planning tests. |
| Identifier case sensitivity | Unquoted identifiers fold to lowercase; quoted identifiers are case sensitive | Table names that differ only by case on Linux need a rename plan. Check every query that quotes identifiers. |
| Collation and string comparison | Collations from the operating system or ICU | Sort order and equality checks can change. Confirm collation choice, since results of ORDER BY and unique constraints may differ. Test, do not assume equivalence. |
Documented import paths: pgloader and Ora2Pg, and when each fits
A MySQL move rarely needs one tool for everything. The cards below cover the two documented migration tools, the manual export and load route, and the checks that decide which combination fits your schema, data volume and downtime window. Confirm current tool versions and options against each project's documentation before you commit to a plan.
pgloader and its MySQL source
pgloader reads MySQL or MariaDB directly and creates the PostgreSQL schema, tables, indexes and data in one run, so it is the most common first step for MySQL moves. Its source support is the main reason it fits this migration. Check which MySQL version, character set and storage engine your schema uses, and confirm that the pgloader release you plan to use documents support for them. Run it against a copy of production first and review every object it created.
Schema discovery and casting rules
pgloader inspects MySQL metadata and applies default casting rules, for example mapping common integer, text and datetime types to PostgreSQL equivalents. Defaults rarely match every column, especially tinyint flags, enum columns, unsigned integers and zero-date values. Export the generated DDL, compare it with your intended PostgreSQL design, and write explicit casting rules for each column that differs. Keep those rules in version control so the cutover run is repeatable.
On-the-fly transformations
pgloader can apply transformations while data moves, such as renaming objects, filtering rows, or converting values with supplied functions. These options reduce post-load cleanup, but each transformation adds logic that must be tested against real data. Before you rely on one, confirm in the current pgloader documentation which transformations are available for your source version, and test each one on a sample that includes null values, invalid dates and mixed character encodings.
Ora2Pg is an Oracle tool first
Ora2Pg is built mainly to assess and migrate Oracle databases, and its reports, PL/SQL conversion and type mappings target Oracle objects. Teams sometimes consider it for MySQL because of its reporting features, but that fit is not established by its primary scope. Before choosing it for MySQL, confirm in the project documentation whether it supports your MySQL version and objects, and run a small proof on your real schema. If MySQL support is limited, use pgloader for the MySQL side.
Manual export with mysqldump or CSV
A manual route exports tables with mysqldump, or with CSV exports from MySQL, and loads them with PostgreSQL COPY. It gives full control over data formats, batching and error handling, and suits schemas that automated tools map poorly. The cost is effort: you write the DDL, sequences, constraints and data-cleaning steps yourself, and you verify each table. Choose this route when the schema is small or when automated tools fail on specific objects.
Choosing the path for your schema
Most MySQL moves combine approaches: pgloader for bulk schema and data, targeted scripts for objects it converts poorly, and manual checks for stored procedures and application SQL. Decide based on how many tables need custom casting, whether triggers or stored routines must move, and how long the load window allows. Confirm current tool versions and options against each project's documentation, and record the decision with its test results so the cutover plan rests on evidence.
How the migration sequence runs from inventory to decommission
The sequence moves a MySQL or MariaDB estate to PostgreSQL in stages, so each step produces evidence that the next one depends on. Each stage ends with a check you can review before the cutover window is booked.
Inventory schemas, routines, triggers and application SQL
Start by listing every database, schema, table, view, stored procedure, function, trigger, event and scheduled job in scope, including the MySQL and MariaDB version and character set in use. Collect the SQL the application sends, from code, ORM mappings, reporting tools and batch jobs, because that code is what the PostgreSQL side must answer. The step is done when the team agrees on a written inventory that names an owner for each object and marks which items are migrated automatically, rewritten by hand or retired.
Run a schema discovery and type mapping review
Use pgloader or Ora2Pg in a read-only or assessment mode against a copy of the MySQL schema to see how tables, keys, indexes, auto-increment columns and column types translate. Review the mapping for tinyint(1), unsigned integers, datetime and timestamp behavior, enum and set columns, and text collations, since these are the usual sources of silent data change. The step is done when each non-trivial type decision has been signed off by the data owner.
Load a pilot into a test PostgreSQL cluster
Build a test PostgreSQL cluster on infrastructure you control, then load a representative subset of tables, including the largest and the most awkward ones, using the tool chosen in the previous step. Record load times, errors, skipped objects and any rows rejected during conversion, then fix the mapping or transformation rules and repeat until the pilot loads cleanly. The step is done when the pilot runs end to end twice with the same results.
Review queries, routines and application behavior
Run the captured application SQL and the rewritten routines against the pilot database and compare results with MySQL for the same inputs. Look for differences in case sensitivity, implicit type conversion, GROUP BY behavior, date arithmetic, LIMIT and upsert syntax, and transaction isolation assumptions, and change application queries or PL/pgSQL code where needed. The step is done when the application test suite passes against PostgreSQL and the team has a list of any behavior changes that stakeholders have accepted.
Set up replication or a repeatable bulk load for the cutover
Decide between a bulk load during a maintenance window and a lower-downtime approach, and build the chosen path in a rehearsal environment. Logical replication is documented by PostgreSQL for moving data between servers with minimal interruption, but it works on tables and needs a source-side change capture approach that the MySQL side supports, so confirm this with the team's chosen tooling before committing. The step is done when a full rehearsal copy has completed and the team knows how long the load and any catch-up take in its own environment.
Validate row counts and checksums during a parallel run
Keep MySQL serving production while the PostgreSQL copy receives the same data, then compare row counts per table and checksums on agreed key ranges or full tables at scheduled intervals. Investigate every mismatch, including differences caused by time zones, character encoding, floating-point values and NULL handling, before accepting the result. The step is done when consecutive validation runs show no unexplained differences and the data owners have signed the reconciliation report.
Take backups and rehearse recovery before cutover
Before the cutover window, configure continuous archiving with a base backup and archived WAL files on the new PostgreSQL cluster, and restore a copy to a separate server to prove the recovery path works. Document the recovery point and recovery time the business expects and test them against that target. The step is done when a point-in-time restore has been completed and checked against the expected data.
Execute the cutover window and keep MySQL for rollback
During the agreed window, stop writes to MySQL, let the final changes reach PostgreSQL, run the reconciliation checks again, repoint the application connection settings and confirm the application works against the new database. Keep the MySQL server available in read-only mode so the team can roll back if a critical defect appears. The step is done when the business owner confirms the application is working and the checks pass.
Decommission MySQL after the retention period
Once the agreed retention period has passed without a rollback decision, take a final archived copy of the MySQL data under your retention policy, remove application credentials and network access, and then shut down the server. Record the decommission in the asset and configuration inventory. The step is done when the MySQL instance is off, its archive is verified, and the change record is closed.
What changes in application queries, drivers and connection handling
Application SQL is where a MySQL to PostgreSQL migration most often breaks after the data has already loaded cleanly. Quoting differs: MySQL's backtick identifiers must become double-quoted identifiers, and PostgreSQL folds unquoted identifiers to lowercase while MySQL's behavior depends on the filesystem and server settings, so mixed-case table and column names need an explicit decision. LIMIT and OFFSET forms generally carry over, but LIMIT offset, count does not, and INSERT ... ON DUPLICATE KEY UPDATE must be rewritten as INSERT ... ON CONFLICT. String concatenation with CONCAT() or || behaves differently around NULL, and default transaction isolation levels and case-sensitivity of comparisons also need checking. Have developers inventory raw SQL and the ORM layer, then run the application's integration tests against the PostgreSQL target before cutover.
Connection handling is a design decision, not a configuration detail. MySQL applications often open many short connections, and PostgreSQL creates a process per connection, so most teams place PgBouncer in front of the server. PgBouncer's pooling modes change which session features the application can rely on, such as session variables, prepared statements and advisory locks, so pick the mode after reviewing the application's use of them. Confirm the PgBouncer version you will deploy against the current PgBouncer site and its security advisories before you standardize on it.
Authentication choices flow into driver configuration. PostgreSQL 18 deprecated MD5 password authentication in favor of SCRAM, so set password_encryption to scram-sha-256, confirm each application driver and PgBouncer release supports SCRAM, and test that existing application roles authenticate correctly. The PostgreSQL authentication methods documentation lists the options your pg_hba.conf can use, including certificate, LDAP, GSSAPI and OAuth, and each one needs matching client settings such as sslmode, certificate paths or Kerberos principals. Record these settings per application so the cutover does not depend on someone remembering them.
What drives the cost and duration of a MySQL to PostgreSQL move
This table lists the factors that change how much work a MySQL or MariaDB to PostgreSQL move takes, whether each cost is one-time or recurring, and what to ask for in a written quote. Read each row against your own schema inventory, because the same driver can be small in one database and large in another. The main takeaway is that most of the effort sits in SQL compatibility, application changes and validation, not in copying rows.
| Driver | Why it changes cost or effort | One-time or recurring | What to ask for in a quote |
|---|---|---|---|
| Number of schemas and tables | More objects mean more type mapping, more constraints to recreate and more tables to validate. | One-time | Object inventory by schema, with counts of tables, indexes, keys and sequences, and the method used to produce it. |
| Stored procedures, functions and triggers | MySQL routines must be rewritten into PL/pgSQL by hand, and each routine needs its own tests. | One-time | A list of every routine and trigger, with a rewrite estimate per object and the test approach for each. |
| MySQL-specific SQL and functions | Syntax such as backtick quoting, GROUP_CONCAT, date functions and REPLACE INTO needs equivalent PostgreSQL forms. | One-time, plus review of new queries | A scan report of MySQL-specific syntax in application code and in database objects, with the replacement plan. |
| Data size and change rate during cutover | A high write rate forces either a longer outage window or a replication-based approach with more monitoring. | One-time for the move, recurring if replication runs for long | The cutover method proposed, how changes are captured during the copy, and the expected lag handling. |
| Number of applications and ORMs | Each application or ORM dialect may need its own query, migration and driver changes and separate regression runs. | One-time, with recurring testing of later releases | A list of applications, drivers and ORM versions, with the change set and test suite each one needs. |
| Acceptable downtime | A short outage window narrows the cutover options and adds rehearsal and rollback work. | One-time | The downtime target in writing, the rehearsal count assumed, and the rollback plan with its own time limit. |
| Required validation depth | Row counts alone are fast, but checksums, sampled row comparison and query-result comparison add time and tooling. | One-time, with ongoing checks if dual running continues | The validation methods listed by name, the tables covered by each, and the sign-off criteria agreed before work starts. |
| Use of MySQL features without a direct equivalent | Features such as certain storage behaviors, character collations or unsigned integer ranges need design decisions that other drivers do not. | One-time | A written decision log for each unmatched feature, with the chosen PostgreSQL design and who approves it. |
Questions teams ask before moving MySQL to PostgreSQL
Can our internal team migrate MySQL to PostgreSQL without a partner?
Yes, many teams do, provided they have someone who can own the schema conversion, the application query changes and the cutover runbook. The deciding factors are how many schemas and stored routines you have, how much of the SQL in your application is MySQL-specific, and whether your team has run PostgreSQL in production before. A small schema with few stored routines and a team that already operates PostgreSQL is a different job from a large MySQL estate with triggers, events and dialect-specific queries spread across several services. Before deciding, ask for a discovery pass that counts objects and flags incompatible constructs, then compare that inventory against your staff's time and experience.
What does the cost of a MySQL to PostgreSQL move depend on?
Cost follows scope and risk, not the tool license, because pgloader and Ora2Pg are open source and the PostgreSQL License is permissive. The main cost drivers are the number of schemas and tables, the volume of stored procedures, functions and triggers that need manual rewriting, the number of applications and queries that depend on MySQL behavior, the downtime window you accept, and the testing you require before cutover. One-time costs include discovery, conversion, rewrites, test data validation and cutover. Recurring costs are the PostgreSQL infrastructure you run, backups, monitoring and patching. When you request a quote, ask for the written scope to list each of these items separately so you can see which parts you could take over yourself.
How do we limit downtime during the cutover?
Downtime depends mainly on whether you can freeze writes for a full bulk load or need to keep the MySQL source running while changes are copied. A one-time offline load is the simplest path and suits systems with an agreed maintenance window. A lower-downtime path loads the bulk data first, then replays changes until the switch, which requires a reliable change capture method on the MySQL side and careful handling of sequences and application writes during the switch. Ask your team to measure how long the full load takes against a copy of production data, because that figure sets the minimum window for an offline approach. Rehearse the cutover at least once, and confirm rollback steps before the production date.
Is pgloader or Ora2Pg the right tool for a MySQL migration?
pgloader is the tool built for MySQL sources, so it is the normal first choice for MySQL and MariaDB schemas and data. Ora2Pg is designed for Oracle and is not the right tool for MySQL. pgloader can read the MySQL catalog, map data types, create tables, indexes and keys, and transfer rows, and it supports on-the-fly transformations through its command file. It does not convert every stored routine or application query, so plan for manual work on those. Confirm the pgloader version and the MySQL and MariaDB versions you use against the project documentation, and run a trial load against a copy before you commit to the approach.
What type and behavior differences should engineers check first?
Start with the differences that silently change results rather than the ones that fail loudly. Check how zero dates and invalid dates are handled, how MySQL's default collations and case sensitivity compare with PostgreSQL's, how boolean columns stored as TINYINT are mapped, and how auto-increment columns become sequences that must be reset after the load. Review queries that rely on GROUP BY behavior, implicit type conversion, LIMIT in subqueries, backtick quoting and functions such as IFNULL or GROUP_CONCAT. Stored routines, triggers and events need separate review because they are rewritten in PL/pgSQL or moved to the application. Build a list of these items from your own schema rather than from a generic checklist.
What does the internal team need to provide during the project?
The team needs a named owner for the schema and data model, at least one engineer who knows each application's database access layer, someone who can run and review test loads, and a person who can approve the cutover window. Application teams must be available to update SQL, ORM mappings and driver settings, and to run their test suites against PostgreSQL. Operations staff need to prepare the PostgreSQL servers, backup and monitoring, and access to the MySQL source during the transfer. Ask any partner to list these roles in the written scope, with the time each one is expected to commit, so you can check availability before work starts.
How long does a pilot take compared with the full migration?
A pilot is usually shorter than the full migration because it covers one representative schema or service, but its duration depends on the same drivers: object count, the number of queries that need changes, data volume and how many people must review results. A good pilot loads a real copy of data, runs the application's test suite and a set of production-like queries against PostgreSQL, and measures the load time that informs the downtime plan. Confirm with any provider what the pilot will prove, which systems it includes and what decision it supports, and ask for the expected duration in the written scope rather than relying on a general estimate.
Where MySQL to PostgreSQL migrations usually go wrong
Most failed MySQL to PostgreSQL migrations do not fail loudly. Data arrives changed, application queries break only on rarely used paths, and routines move over incorrectly, all while the cutover looks successful. Each card below names one risk and the preventive check to run before the migration window opens.
Silent data changes from coercion
MySQL in permissive modes accepts out-of-range values, truncates strings and stores zero dates such as 0000-00-00, which PostgreSQL rejects or represents differently. Loading with pgloader can succeed while rows are altered. Before cutover, run row counts and checksums per table, and sample rows containing zero dates, nullable columns, ENUM and SET values, and DECIMAL precision on both sides. Compare values, not only counts.
Application SQL that fails in production paths
Queries using MySQL-specific syntax, implicit type conversion, GROUP BY without strict grouping, LIMIT in subqueries or backtick quoting may pass in staging but fail in rarely executed reports, batch jobs and error handlers. Capture the statements your application actually sends, including ORM output, and run them against the PostgreSQL target. Treat every statement that does not execute as a blocker, not a warning.
Stored routines and triggers mistranslated
Stored procedures, functions, events and triggers rarely convert automatically. MySQL's DELIMITER-based bodies, variable handling and signal statements need manual rewriting in PL/pgSQL, and scheduled events have no direct equivalent that schema conversion carries across. Inventory every routine and trigger, assign an owner, and test each one against known inputs with expected outputs before cutover.
Collation and encoding mismatches
MySQL collations such as case-insensitive utf8mb4 defaults can change sort order, uniqueness and comparisons once the data sits in PostgreSQL, where text comparison is case-sensitive by default and collation follows the database locale. Duplicate keys can appear after folding, and sorting in reports can shift. Confirm the database encoding and locale at creation, decide per column which collation applies, and test unique constraints and ORDER BY output with real data.
Cutover without a tested rollback
A cutover plan that only describes moving forward leaves the team stuck when a defect appears after writes land in PostgreSQL. Decide in advance whether rollback means reverting to MySQL with a reverse sync or accepting a data-loss window, and rehearse both the cutover and the rollback on a copy of production. Record the time each step takes, who can authorize a rollback, and the criteria that trigger one.
How source, loader, validation and the new cluster fit during the parallel run
The flow starts at the MySQL or MariaDB source, where schema discovery feeds a type-mapping review before pgloader or a documented export and COPY path moves the data into the PostgreSQL cluster you run. Validation checks compare row counts and sampled values against the source, while the application runs in parallel against both databases. The cutover decision is only taken when those checks pass, and the rollback path keeps the MySQL source available until the new cluster is accepted.
Source, loader, validation and new cluster during the parallel run.
How to validate data before the cutover decision
Validation decides whether the cutover happens, so the team should write acceptance criteria before the pilot begins. Agree in writing which checks must pass, who signs off on each one, and what happens when a check fails. For a MySQL to PostgreSQL move, the baseline comparison covers row counts per table, primary and unique key integrity, foreign key relationships after load, and the handling of values that changed meaning in translation, such as zero dates, tinyint(1) booleans, and case-sensitive collations. Run these counts on the source and target at the same logical point, which means after the source has been frozen or after the replication lag has reached zero. Compare full-table checksums where the data volume allows it, and use sampled row-level checksums on the largest tables, keeping the sample seed and method documented so the result can be reproduced.
Application test results are the check that most often reveals problems the data comparison misses. Run the regression suite and the critical business transactions against the PostgreSQL target, and record every query that returns a different result set, sort order or error, including differences from GROUP BY behavior, implicit type coercion and NULL handling. Confirm that the target can be restored, not only that a backup exists. Take a base backup, archive WAL continuously, and perform a point-in-time recovery to a chosen timestamp on a separate server, then run the same validation queries against the restored copy. The PostgreSQL continuous archiving documentation describes the base backup and WAL archive combination that makes this restore test possible. Confirm with your own team the retention period and the recovery time target the business requires before signing off on the cutover decision.
The cutover decision should rest on the written acceptance criteria, not on a feeling that the migration looks correct. If any row count, checksum or critical test fails, record the cause, fix the mapping or load script, and rerun the affected stage before the decision is revisited. Keep the MySQL source available and unchanged for the rollback period agreed in advance, and document the exact point at which rollback is no longer practical because writes have landed only in PostgreSQL. Retain the validation outputs, the restore test record and the sign-off list as evidence, since auditors and internal risk teams will ask how the decision was reached.
Who does what: internal team versus DeployOpen
Your organization keeps the decisions that depend on knowledge of the business and its data. Application owners know which features, reports and batch jobs depend on current MySQL behavior, and they decide what functionality must survive the move. DBAs own the source and target environments, access to them, and the operational runbooks that will be used after cutover. Data owners decide which tables contain regulated or retained data, what can be transformed, and how disputed values are resolved during validation. Change approvers sign off on the cutover window, rollback criteria and the go or no-go decision.
- Application owners: list the queries, ORMs, stored routines and reporting consumers that touch the schema, and approve the query changes.
- DBAs: provision the PostgreSQL servers, storage, backups, and network paths, and manage the MySQL source access during the migration.
- Data owners: confirm retention rules, classify sensitive columns, and decide how invalid or truncated legacy values are handled.
- Change approvers: agree the cutover plan, rollback conditions and the freeze period for writes on the source.
- Staff time: confirm in advance who will be available during testing and cutover, since these people are usually not dedicated to the project.
Check that each role has a named person and that the people who approve changes can answer for the business impact of a rollback.
DeployOpen's documented scope covers the technical migration work: inventory of the MySQL or MariaDB source, conversion of the schema and data using pgloader or the tooling agreed for the project, loading into PostgreSQL, validation and cutover support, and handover of the results. The exact deliverables for each phase are written into the scope before work starts, so your team knows what it will receive and what it must provide in return.
- Inventory: catalog tables, indexes, keys, triggers, views, routines and character set settings on the source.
- Conversion: map MySQL types to PostgreSQL equivalents, set up any on-the-fly transformations, and document each rule.
- Loading: run test loads and the production load, and record row counts and load logs.
- Validation: compare counts, checksums or sampled rows, and report discrepancies with the rules that produced them.
- Cutover support and handover: assist during the agreed window and deliver documentation, runbooks and the open findings list.
Ask for a written list of deliverables, the environments covered, and the named roles on both sides before signing.
Most engagements are fixed-scope, so the deliverables, acceptance criteria and timeline are agreed in writing before any work begins. The written scope is the reference point for both parties, and changes to it are handled through a documented change request rather than informal agreement. Because the scope depends on the size and complexity of the MySQL estate, DeployOpen does not publish a fixed duration, and the timeline should come from the scope discussion, not from general estimates.
- Written scope: agree the databases, schemas, applications and environments included, and what is excluded.
- Acceptance criteria: define what counts as a successful validation, including tolerated differences and how they are documented.
- Timeline: agree milestones for inventory, test loads, validation, and the cutover window.
- Change control: agree how new findings, such as undocumented triggers, are priced and scheduled.
- Support after handover: clarify whether post-cutover support is included or sold as a separate retainer.
Before signing, confirm who approves each milestone on your side and what happens if a milestone slips.
The migration is complete when your team can operate the new PostgreSQL databases and the applications that use them. Handover transfers knowledge and artifacts so that DBAs and application owners can maintain the system without the project team. Documentation should describe the type mapping decisions, the transformation rules, the validation results and any known differences that the business accepted. Ownership of the code, configuration and runbooks should be clear before the project ends.
- Documentation: type mapping tables, conversion scripts and transformation rules, with the reason for each decision.
- Validation record: counts, checksums and the list of accepted discrepancies, signed off by data owners.
- Runbooks: backup, restore, monitoring and rollback procedures for the PostgreSQL environment.
- Knowledge transfer: working sessions where your DBAs and developers run the load and validation steps themselves.
- Open items: a tracked list of remaining work, owners and due dates after the project closes.
Check that your team can rerun the migration scripts and restore the target from backup without DeployOpen involvement.
Decommissioning MySQL and keeping the rollback path
Do not remove the MySQL source until PostgreSQL is running the production workload with its own high availability, tested backups and an upgrade plan in place. Once the source is gone, the rollback path goes with it, so the order matters. Agree a retention period in writing before cutover, and set the MySQL server to read-only for that period with super_read_only enabled and application accounts revoked, so nothing writes to the old data while you are still able to fall back to it. Confirm the exact enforcement settings and their behavior with your MySQL or MariaDB version's documentation, and test that a write attempt from an application account fails.
Keep evidence that an auditor or incident responder will ask for: the signed cutover plan, the row count and checksum reconciliation results from the validation stage, the final logical dump and its checksum, the schema export as it stood at cutover, the change record for the read-only setting, and the timestamps for each step. Store these in a location the old source's retirement does not affect. If your controls require it, record who approved the retirement and when, and keep the record for the period your retention policy sets. Ask your compliance lead which records they need before the retention window opens, not after.
Retire access in a deliberate order. Disable application and service accounts on MySQL first, then remove replication and administrative accounts, and rotate any credential that appeared in configuration files, scripts or pipelines that now point at PostgreSQL. Revoke the MySQL backups only after you have confirmed that a restore into PostgreSQL works from your PostgreSQL backups, and preserve a final MySQL backup under the same retention rule as the evidence. Delete the source server only after the retention period ends and a second approver confirms the evidence is complete.
How to start a scoped MySQL to PostgreSQL engagement
This sequence turns an unknown MySQL estate into a written, scoped plan with a pilot as the first test of the migration path. Each step produces a document or check that the next step depends on.
Gather the database inventory
Your team lists every MySQL or MariaDB instance, schema, and application that connects to it, along with versions, storage size, character sets, stored routines, triggers, events, and scheduled jobs. DeployOpen reviews the list with you to find gaps, such as applications nobody remembers or reporting tools that query production directly. The step is done when you have a signed-off inventory that names an owner for each database and the business process it supports.
Run a discovery assessment
DeployOpen connects to the source in read-only mode and profiles the schemas, column types, keys, indexes, and SQL dialect features in use, such as MySQL-specific functions, zero-date values, and non-standard storage engines. The assessment lists which objects convert directly, which need a type decision, and which need manual rewriting in the application or in stored code. The output is a written assessment report that you can review with your application owners before any scope is agreed.
Confirm access and environment requirements
Your team confirms the network paths, credentials, and change windows needed for the source and target, and states where the PostgreSQL target will run, including the cloud account, data center, or air-gapped network. DeployOpen records the tooling choice between pgloader and Ora2Pg-style workflows and the test environments available for rehearsal. The step is complete when access has been verified in writing and the target platform is named in the plan.
Agree a written scope and deliverables
DeployOpen drafts a scope document covering the in-scope databases, the type mapping decisions, the application changes, the data validation method, the cutover approach, and the handover items. Each deliverable is named with an owner and an acceptance check. Timelines are stated as milestones tied to your decisions and test results, and any open questions are listed with the party responsible for answering them. The scope is final when both sides sign it.
Define the pilot scope and success checks
Your team selects one bounded database or schema for a pilot, preferably one with a clear owner and limited dependencies. DeployOpen and your application team agree the checks that show the pilot worked, such as row counts, checksums on sampled tables, query result comparisons, and the list of application queries that must be retested. The pilot's acceptance criteria are written into the scope so the migration path is judged on evidence.
Run the pilot migration and review results
DeployOpen runs the schema and data migration for the pilot on a non-production PostgreSQL instance, applies the agreed type mappings and transformations, and records every deviation. Your application team runs its test suite against the migrated database and logs query changes. The step closes with a pilot report listing the checks passed, the issues found, and the decisions needed before the full migration is scoped in detail.
Decide on the full migration plan
Using the pilot report, your team and DeployOpen update the scope for the remaining databases, including revised estimates for application changes and the cutover method, whether that is a planned outage with a final data load or a replication-based approach. Any items the pilot could not settle are assigned owners. The step is complete when a revised written scope has been approved and the cutover approach is recorded.
How DeployOpen scopes, delivers and supports the migration
DeployOpen plans, builds, tests and documents MySQL or MariaDB to PostgreSQL migrations inside the infrastructure you control, from the first schema discovery run through cutover. Most engagements are fixed-scope, so the scope, deliverables and timeline are agreed in writing before work starts.
How we scope
- The written scope lists which MySQL or MariaDB schemas, tables, routines and applications are included.
- We confirm the target PostgreSQL major version and the planned cutover window with your team.
- Your application query inventory and type-mapping decisions are recorded as agreed deliverables before the build.
How we build
- We run pgloader and schema discovery against a copy, then review the type mapping and generated DDL with you.
- Application SQL that depends on MySQL-specific behavior is identified, rewritten and tested against PostgreSQL.
- Each migration run is repeated against refreshed copies so row counts, checksums and sample queries are compared every time.
How we hand over
- You receive the migration scripts, transformation rules, type mapping decisions and a validation report.
- The cutover runbook covers freeze, final sync, rollback criteria and sign-off steps agreed with your application owners.
- Operational documentation covers the PostgreSQL configuration, backups and access controls set up during the build.
How we support
- Post-cutover support covers issues found in the first production period, scoped in the same written way.
- Ongoing support, upgrades and continuous testing are available as a retainer after handover.
- Your team can ask us to retest migration tooling and application queries when schemas or PostgreSQL versions change.

