Database Migration to PostgreSQL

Database Migration to PostgreSQL: Assess, Convert, Validate, Cut Over

Last reviewed by Tyler Eastridge

AceMQ provides database migration services to PostgreSQL from Oracle, SQL Server and MySQL. We assess the estate, convert the schema and the procedural code, move the data with the tool that fits your downtime budget, prove the copy is right, and cut over with a rollback we have rehearsed. The tools convert the tables. The cost is in the stored procedures and the applications that call them, so that is where we start.

source engines covered: Oracle, SQL Server and MySQL
3
quote reply once we have the engine, database count and sizes
1 hour
Sev 1 response SLA once the target is on a support plan
15 min

Is This You?

You probably need this if…

  1. 01

    An Oracle or SQL Server renewal is coming and the case for leaving has never been costed properly

  2. 02

    A tool vendor says the conversion is mostly automatic and you want an independent view of what is not

  3. 03

    Hundreds of stored procedures, packages or jobs hold business logic and nobody knows how much of it converts

  4. 04

    SQL Server 2016 is past its extended support date, or MySQL 8.0 is on Sustaining Support, and the choice is upgrade or change engine

  5. 05

    Applications speak T-SQL or Oracle SQL and cannot all be rewritten before the cutover date

  6. 06

    You need old and new running side by side, with a way back that your change board will sign

Outcomes

Where you are now, and where you end up

Concrete state changes, not deliverable counts. This is what actually differs about your PostgreSQL estate when the engagement closes.

  1. Before

    The migration case is a license saving on a slide, with no view of the conversion work.

    After

    Every object classified as automatic, needs review or needs rewrite, with a recommended route and a stay-or-go view per database.

  2. Before

    A vendor demo converts a sample schema and the stored procedures are discussed later.

    After

    One representative database converted, loaded and tested against its real application, so the plan rests on evidence.

  3. Before

    Validation is a row count and a hopeful application test.

    After

    A validation suite that compares data, sequences, NULL handling, collation behavior and the results of your real queries.

  4. Before

    The cutover plan ends at the switch.

    After

    A rehearsed cutover with an agreed point of no return, a rollback for each side of it, and hypercare until PostgreSQL is stable.

Recognise your estate here? Get a quote for PostgreSQL migration from a senior engineer.

Contact Us

Scope

What's covered

  • 01

    Estate Assessment

    Schemas, objects, procedural code, jobs, links to other systems, data volumes and write rates, with each object classified by conversion effort. Ora2Pg, AWS Schema Conversion Tool and Babelfish Compass reports are inputs, not the answer.

  • 02

    Schema and Code Conversion

    Tables, indexes, constraints and partitions through the tools, then PL/SQL or T-SQL reviewed and rewritten by engineers, with the changes kept in version control so they can be re-run.

  • 03

    Data Movement and Sync

    A one-time load where a write freeze is acceptable, or full load plus change capture where it is not, using pgloader, AWS DMS, Debezium or the source's own export, chosen per database.

  • 04

    Validation

    Counts, key-range aggregates, sequence positions, empty-string and NULL behavior, case-only duplicates, and replay of your top statements with result and plan comparison.

  • 05

    Cutover and Rollback

    A rehearsed runbook, a write freeze you can time, and a rollback defined for the period before and after PostgreSQL takes its first write.

  • 06

    Landing Platform and Support

    High availability, backups, monitoring and tuning on the PostgreSQL side, and optional 24/7 support or managed operation from the team that did the move.

Want a senior PostgreSQL engineer to scope this with you? Get a quote or send us a message.

Contact Us

The Engagement

How it actually runs

Every phase has a defined duration and a concrete artifact handed over at the end of it. You always know what stage you're in and what you've received.

  1. Phase 1First step

    Assessment

    We inventory what you run and classify it. Delivery is remote and guided by your engineers, with access scoped to what each phase needs and agreed before it starts. The output decides whether to convert, to use Babelfish as a bridge for SQL Server, or to stay.

    You receive

    • Inventory of schemas, objects, code, jobs and dependencies
    • Effort classification per object
    • Route recommendation and risk register
  2. Phase 2One database

    Proof of Value

    One representative database is converted, loaded and run against its application tests before anyone commits to the rest. It surfaces the real defect categories while they are still cheap.

    You receive

    • Converted schema and code for the sample
    • Defects grouped by cause
    • Revised plan and wave order for the rest
  3. Phase 3Per wave of databases

    Convert and Sync

    Conversion scripts, data load and change capture are built once and re-run for each wave. Validation runs continuously while the target syncs, not once at the end.

    You receive

    • Conversion scripts in version control
    • Load and sync runbook per database
    • Validation suite and a defect log
  4. Phase 4Per cutover

    Cutover and Hypercare

    Each cutover is rehearsed on a copy first. The rollback decision point is agreed in advance, and we stay engaged until PostgreSQL is stable under real load.

    You receive

    • Executed cutover with timed phases
    • Post-cutover review
    • Handover pack: runbooks, dashboards and alerts

Three routes to PostgreSQL and what each one needs

The route is set by the source database engine. The migration tools and the data move are similar everywhere. What differs is the procedural language, the types and the behaviors the application has quietly come to depend on.

Migration routes to PostgreSQL: tooling and where the effort goes
RouteTooling that does the mechanical workWhere the effort concentratesSection
Oracle to PostgreSQLOra2Pg for assessment, DDL, data export and first-pass PL/SQL. AWS Schema Conversion Tool or DMS Schema Conversion on AWS. AWS DMS or Debezium for change capture.PL/SQL packages and package state, autonomous transactions, empty-string and NUMBER semantics, transaction error behavior, high availability design.Oracle
SQL Server to PostgreSQLBabelfish for PostgreSQL to keep T-SQL applications running, or conversion with AWS SCT or DMS Schema Conversion. pgloader for a one-time load, AWS DMS or Debezium for change capture.T-SQL procedures and result sets, temp tables, collations, jobs and linked servers that live outside the engine, change-capture prerequisites.SQL Server
MySQL to PostgreSQLpgloader for a one-time load. AWS DMS or Debezium when MySQL keeps taking writes.Case-insensitive collation, unsigned and ENUM types, zero dates, upsert syntax, application SQL written for MySQL.MySQL

Oracle to PostgreSQL: Ora2Pg, AWS SCT and DMS, and the PL/SQL problem

Ora2Pg is a free tool, released under GPL-3.0, that scans an Oracle database and exports tables, views, sequences, indexes, constraints, partitions, functions, triggers and packages as PostgreSQL DDL, plus the data. It also produces a migration assessment that scores the difficulty and cost of the database before you start. Its own documentation describes the PL/SQL conversion as basic and says the generated functions, procedures, packages and triggers have to be reviewed. That review is the project.

On AWS, the Schema Conversion Tool produces an assessment report and puts action items into the converted code where it could not finish the job. AWS DMS moves the data with a full load and then ongoing change capture. It reads Oracle redo with LogMiner by default, or with Binary Reader, which AWS lists as lighter on the source and faster for change capture but without table cluster support. Both need supplemental logging enabled on the source. Debezium's Oracle connector is the alternative when the change events also need to reach Kafka or RabbitMQ.

Data types need an explicit map before any data moves: Oracle NUMBER to integer types or numeric, DATE (which carries a time) and TIMESTAMP WITH TIME ZONE to the matching PostgreSQL timestamp types, BINARY_FLOAT and BINARY_DOUBLE to real and double precision, and large objects (CLOB and BLOB) to text and bytea. The map decides how each table is created on the PostgreSQL side and what the validation step compares.

Oracle behaviors that break after conversion
OraclePostgreSQLWhat we check
Empty string is NULLAn empty string and NULL are different valuesCode that tests IS NULL to find blank text, NOT NULL columns that hold empty strings today, unique indexes on nullable text.
NUMBER without precisionnumeric, or integer and bigint if the data is wholeChoose per column from the data. numeric is slower than integer, and the AWS tool can map NUMBER keys to bigint only if no fractions exist.
DATE holds a time of daytimestamp(0). PostgreSQL date has no timeEvery DATE column and every comparison against SYSDATE.
Packages and package stateSchemas holding functions. No package-level statePackage variables, initialization blocks and the order they run in.
Autonomous transactionsNo native equivalentAudit and logging routines that commit independently. Redesign, or emulate with dblink.
Statement-level rollbackAn error aborts the whole transaction until a savepointApplication retry logic, and every PL/pgSQL EXCEPTION block, which opens a subtransaction.
CONNECT BY, (+) joins, ROWNUM, DECODERecursive CTEs, ANSI joins, LIMIT or row_number(), CASETools convert many of these. Review the plans, and rewrite deeply nested queries by hand.
ROWID and sequencesROWID has no counterpart. Sequences must restart past the loaded maximumWhether any code relies on ROWID. The AWS tool can create a data column to keep the values.
Unquoted names fold to upper caseUnquoted names fold to lower caseQuoted mixed-case identifiers in application SQL.
RAC and Data GuardStreaming replication with failover tooling such as Patroni. No shared-storage active-active equivalentHigh availability is a design deliverable of its own, not a conversion output.

The orafce extension supplies Oracle-compatible functions and the AWS tool can target it, which shortens the rewrite where code leans on them. It is a bridge, not a destination: each function you keep is one more thing to remember when the next engineer reads the code.

Where the cost sits

Tools convert tables and indexes in minutes. The cost is business logic in PL/SQL, jobs and cross-database links. The more of it there is, the further the estate is from automatic. That is why we convert and test one database end to end before committing to a plan for the rest.

Ready to talk PostgreSQL? Get a quote or send us a message.

Contact Us

SQL Server to PostgreSQL: Babelfish, conversion and change capture

SQL Server 2016 is one common trigger. Microsoft's lifecycle page shows extended support ended on 14 July 2026, with paid Extended Security Updates running to July 2029 (checked 31 October 2026). That makes the engine decision a dated one for some estates.

SQL Server to PostgreSQL: Babelfish or full conversion
ApproachHow it worksFits whenWatch for
Babelfish for PostgreSQLPostgreSQL accepts connections over the SQL Server wire protocol (TDS) and understands T-SQL. OLEDB, ODBC, JDBC and ADO.NET Entity Framework clients are documented as working; the jTDS driver is not supported.Many applications, vendor packages or ORMs speak T-SQL and cannot be rewritten in one release.It does not cover every SQL Server feature. Run Babelfish Compass over your DDL and SQL first. It needs a PostgreSQL build with Babelfish's hooks, so the PostgreSQL version follows the Babelfish release.
Full conversionT-SQL becomes PL/pgSQL and standard SQL, and applications move to PostgreSQL drivers. AWS SCT or DMS Schema Conversion do the first pass, and pgloader can read SQL Server directly.The application is yours and is being changed anyway, or you want no compatibility layer in the end state.The largest code change, and the cleanest result.
Babelfish first, native laterCut over on Babelfish, then convert applications one at a time to native PostgreSQL.Deadline pressure now, and a longer runway for the rewrite.Two states to support and test. The plan has to say when Babelfish goes.
  • Result sets — PostgreSQL procedures do not return result sets. T-SQL procedures that do become functions returning a table or cursor, and every caller changes with them.
  • Error and row handling — TRY/CATCH, @@ROWCOUNT and SCOPE_IDENTITY() become EXCEPTION blocks, GET DIAGNOSTICS and RETURNING.
  • Temp tables and table variables — They have PostgreSQL counterparts, but statistics and scoping behave differently, so reporting procedures that lean on them need timing, not just translation.
  • Collation — Common SQL Server collations are case-insensitive and PostgreSQL's default is not. Unique constraints and login lookups are where it shows.
  • Types — pgloader maps bit to boolean, uniqueidentifier to uuid and datetime to timestamptz. Whether timestamptz is right depends on what your application assumes about time zones.
  • Outside the engine — SQL Agent jobs, linked servers, SSIS packages, SSRS reports and CLR assemblies are not database objects. Each needs a named replacement in the plan.

For the data move, pgloader reads SQL Server and loads schema, indexes, keys and data once; its documentation does not describe change capture. For a live source, AWS DMS reads changes through MS-Replication or MS-CDC. It needs the database in the Full or Bulk-logged recovery model with a backup taken first, and AWS documents that identity properties are not migrated, that temporal tables, sparse columns, columnstore indexes and memory-optimized tables are not supported, that changes to computed columns are not replicated, and that events can be lost if SQL Server truncates the log before DMS reads it. Those limits belong in the plan before the tool is chosen.

MySQL to PostgreSQL: the data is easy and the dialect is not

Moving MySQL to PostgreSQL is mostly not a data problem. pgloader reads a MySQL database, converts the schema, loads the data in parallel and resets sequences, which covers a one-time load where a write freeze is acceptable. When MySQL keeps taking writes, AWS DMS or Debezium read the binary log and keep PostgreSQL in sync until the switch.

  • Collation — MySQL's default collation is case- and accent-insensitive and PostgreSQL's is not. Search the existing data for values that differ only by case before loading them into a unique index.
  • Types — No unsigned integers, so widen the type and add a CHECK. ENUM and SET need a decision. Zero dates are rejected and have to become NULL or a real date.
  • Syntax — INSERT ... ON DUPLICATE KEY UPDATE becomes ON CONFLICT DO UPDATE, and REPLACE INTO has no direct equivalent. The change lives in application code and ORM calls.
  • Triggers and views — pgloader does not migrate triggers. They are rebuilt by hand and tested.
  • Why now — MySQL 8.0 has been on Oracle Sustaining Support since 21 April 2026. If a supported version is the only goal, upgrading to 8.4 LTS is a much smaller change. Move engines for a reason beyond the date: extensions such as PostGIS or pgvector, richer SQL, a permissive license.

Recognise your estate here? Get a quote for PostgreSQL migration from a senior engineer.

Contact Us

Validation, cutover and rollback on every route

The same spine runs under all three routes. Nothing on the list is exotic. The discipline is doing every item, in order, on a rehearsal before the real window.

  • Rehearse — Run the full runbook on a copy of production at least once and time each phase. The write freeze is the number the business cares about.
  • Sync — Keep the target database fed by change capture (data replication) until the lag is nil, with one system accepting writes at any moment.
  • Validate while syncing — Row counts and aggregates over key ranges, sequence values above the table maximum, NULL against empty string, case-only duplicates, permissions and extensions.
  • Replay real queries — Run your top statements against both databases, compare the results, then compare the plans on the PostgreSQL side. Run the month-end and batch jobs, not just the screens.
  • Cut over — Freeze writes, drain the last changes, run the final comparison, switch connections and smoke-test the critical paths.
  • Roll back — Until PostgreSQL takes its first write, the source is untouched and rollback means pointing back. After that it needs reverse replication or a replay of the writes. The point of no return is agreed in advance and written into the change request.

Rule we hold

Never combine a platform migration with a version upgrade or a major application release in the same production window. If the source has to be upgraded first, that is its own change.

Who this migration service is not for

  • A data copy only — If the schema is simple and the application already runs on PostgreSQL, AWS DMS, Azure Database Migration Service or pgloader with your own engineers may be all you need.
  • A supported version, not a new engine — If the real problem is a lifecycle date, upgrading the current database is usually the smaller change.
  • Estates built on Oracle-only platforms — Applications that depend on RAC, Exadata, APEX, Forms or E-Business Suite at depth may be cheaper to keep. We cover the database, not those application platforms.
  • A fixed price and date before assessment — We scope after the assessment and a proof of value, because the estate decides the effort. Quotes come back within 1 hour of getting your engine, database count and sizes.
  • A guarantee of automatic conversion — No honest provider can give one for procedural code. We tell you what converts, what needs review and what needs rewriting.

Want a senior PostgreSQL engineer to scope this with you? Get a quote or send us a message.

Contact Us

Typical engagements

How these engagements run

Typical engagement scenarios: what the work covers and what it delivers. They describe the service, not past results.

1 / 8 case studies

All use cases

FAQ

Questions about PostgreSQL migration

Can AceMQ migrate Oracle to PostgreSQL?

Yes. We assess the estate with Ora2Pg and the AWS Schema Conversion Tool reports, convert one representative database end to end as a proof of value, then plan the rest in waves. Data moves by a one-time load or by AWS DMS or Debezium change capture. The PL/SQL is converted and reviewed by engineers, because Ora2Pg's own documentation says its generated code has to be reviewed. We do not promise an automatic conversion.

Should we use Babelfish to migrate SQL Server to PostgreSQL?

Babelfish is worth assessing when many applications speak T-SQL and cannot be rewritten at once. PostgreSQL then accepts SQL Server client connections and T-SQL, but not every feature, and it needs a PostgreSQL build with Babelfish's hooks. We run Babelfish Compass over your scripts first. If the application is yours and being changed anyway, full conversion to native PostgreSQL gives a cleaner end state.

Can a database be migrated with zero downtime?

Near zero. Load a snapshot, keep PostgreSQL in sync with change capture until the lag is nil, then freeze writes briefly, drain the last changes and switch. The outage is the write freeze, not the copy. The achievable freeze depends on write rate, validation time and the application, which is why we time it on a rehearsal first.

How long does a database migration take and what does it cost?

It depends on the number of databases, the amount of procedural code and the downtime allowed, so we do not publish fixed durations or prices. We scope after the assessment and proof of value. Send us the source engine, database count and sizes, and we reply within 1 hour, with a written quote to follow.

Who does the work, and what happens after cutover?

AceMQ delivers the migration with partner database specialists, working remotely with your engineers and agreeing access phase by phase. After cutover you can keep the platform yourselves, put it under 24/7 PostgreSQL support, or have it run as a managed service on your infrastructure or ours.

Let's talk

Scope Your Migration to PostgreSQL

Tell us the source engine, how many databases and their sizes, and how much procedural code you have. We will reply within 1 hour and follow with an assessment plan and a written quote.

Email Us

Get in Touch

Talk to a PostgreSQL Expert

Send us a message and we'll follow up within 1 hour — or book a free 30-min consultation directly.

305-204-2607
info@acemq.com
66 W. Flagler St. 9th Floor
Miami, FL 33130

Prefer to talk now? Call us directly or use the consultation tab to find a time that works.

We respond within 1 hour.

Pick a time that works — no pressure, no pitch. Just 30 minutes with an expert.

We respond within 1 hour.