Free audit

View Audit Scope
PostgreSQL MigrationOracle, SQL Server, MySQL & Logical Cutovers

PostgreSQL Migration Services & Logical Cutovers

JusDB delivers end-to-end PostgreSQL migration services for heterogeneous database migrations (Oracle to PostgreSQL, SQL Server to PostgreSQL, and MySQL to PostgreSQL) and cross-environment logical replication cutovers. Senior PostgreSQL engineers convert schemas and PL/SQL or T-SQL procedures with ora2pg and pgloader, synchronize live writes with native logical replication, pglogical, or Debezium CDC, verify row checksums, and execute rehearsed cutovers with reverse-replication rollback gates.

Moving an existing PostgreSQL cluster specifically to AWS RDS, Aurora, Cloud SQL, or Azure? Explore our dedicated PostgreSQL Cloud Migration service, or see PostgreSQL Major Version Upgrades.

The first 30-minute call covers your databases, current ownership, and required coverage. No production access is needed. Mutual NDA before access · rehearsed cutover runbooks · verified row checksums.

PostgreSQL Migration Tracks

Select a migration track

Oracle to PostgreSQL (ora2pg)

Commercial Exit

Schema complexity scoring and DDL conversion with ora2pg, NUMBER/DATE/VARCHAR2 type mapping, PL/SQL package and trigger refactoring to PL/pgSQL, and Change Data Capture sync.

We convert autonomous transactions, BULK COLLECT loops, and Oracle sequences into idiomatic, high-performance PostgreSQL.

Compare Oracle vs PostgreSQL

Every cutover includes sequence parity checks, row-hash validation, and a rehearsed rollback gate.

P1 response SLA
P1 – 15 mins | P2 – 30 mins | P3 – 60 mins
Source engines migrated
Oracle Database · Microsoft SQL Server · MySQL & MariaDB · legacy PostgreSQL (9.6-14)
Conversion & CDC stack
ora2pg · pgloader · native logical replication · pglogical · Debezium · AWS DMS
Cutover safety rails
Chunked SHA-256 row checksums · automated sequence sync · reverse-replication rollback gate

Selected clients

  • Innoviti
  • Blitz
  • Freecharge
  • Nango
  • Recochain
  • Screen Facts
  • Nexora
  • WeCredit

Why database migrations stall or fail at cutover

PostgreSQL migration failure modes we engineer out up front

Copying tables is the easy 20% of a migration. The hard 80% is type fidelity, stored procedure refactoring, source WAL protection, sequence synchronization, and rollback safety.

Common PostgreSQL migration failure modes, root causes, and how JusDB engineers prevent them
Migration RiskWhat is usually happeningHow our migration engineers solve it
Oracle NUMBER & DATE TrapsSilent precision loss or broken index scans after schema exportUnconstrained Oracle NUMBER columns map to slow NUMERIC instead of BIGINT/INTEGER, and Oracle DATE includes timestamps that break PostgreSQL date comparisons.Audit column cardinalities in ora2pg, map integer keys to BIGINT/INT, convert SYSDATE/NVL/DECODE expressions, and benchmark execution plans.
PL/SQL Package & Cursor DriftStored procedures fail on transaction control or subtransaction bloatNaive line-by-line translation wraps every PL/SQL EXCEPTION block into a PostgreSQL subtransaction, overflowing SubtransSLRU under concurrency.Refactor Oracle packages into PostgreSQL schemas, rewrite cursor loops into set-based SQL or CTEs, and eliminate unnecessary exception savepoints.
Sequence & Identity DesyncDuplicate primary key errors immediately after cutoverLogical replication streams table rows cleanly, but sequence state (last_value) is not automatically replicated by native publications.Script automated sequence synchronization (setval(pg_get_serial_sequence(...), MAX(id))) inside the cutover freeze gate before opening application writes.
Replication Slot WAL ExhaustionSource database disk fills to capacity during initial table syncLong initial copy phases or stalled apply workers hold open the replication slot's restart_lsn, preventing the source from recycling WAL / redo logs.Set max_slot_wal_keep_size guardrails, chunk multi-terabyte initial loads by table or partition, and monitor pg_wal_lsn_diff byte lag continuously.
Missing REPLICA IDENTITYUPDATE and DELETE statements fail to replicate on tables without PKsPostgreSQL logical decoding requires a primary key or unique NOT NULL index (REPLICA IDENTITY USING INDEX) to identify updated or deleted tuples.Run a pre-flight catalog check across all tables, add surrogate keys or unique indexes before creating publications, and avoid REPLICA IDENTITY FULL table scans.
No Reverse-Sync Rollback GatePost-cutover application edge cases force an unrecoverable outageTeams switch DNS or connection strings to the new PostgreSQL target without a way to stream new target writes back to the legacy database if rollback is needed.Configure reverse CDC or logical replication from target back to source before cutover so fallback remains a controlled switch rather than data loss.

Migration engineering workstreams

End-to-end PostgreSQL migration scope

From initial schema complexity scoring and PL/SQL refactoring to live logical replication and cutover hypercare, every phase produces verifiable engineering artifacts.

  • Discovery, Complexity Scoring & Sizing

    We inventory schemas, data types, stored procedures, triggers, and query patterns to produce a deterministic migration architecture and schedule.

    • Automated ora2pg / schema compatibility assessment and effort matrix
    • Target PostgreSQL sizing for CPU, RAM, IOPS, and connection pooling

    ora2pg · pgloader · AWS SCT · pg_catalog pre-flight scripts

  • Schema, Data Type & Code Refactoring

    Convert proprietary Oracle PL/SQL, SQL Server T-SQL, or MySQL dialects into idiomatic, maintainable PostgreSQL schemas and PL/pgSQL functions.

    • Precision type mapping (NUMBER, VARCHAR2, TINYINT, DATETIME, LOBs)
    • Refactoring packages, triggers, sequences, and partitioning (pg_partman)

    PL/pgSQL · orafce · pg_partman · Babelfish · PostGIS

  • Live CDC & Logical Replication Pipelines

    Stream ongoing source changes to the target PostgreSQL cluster during the bulk load so the final cutover only requires draining in-flight writes.

    • Native PostgreSQL publications/subscriptions and pglogical pipelines
    • Heterogeneous CDC with Debezium, Kafka, or AWS DMS for Oracle/SQL Server

    CREATE PUBLICATION / SUBSCRIPTION · pglogical · Debezium · AWS DMS

    Explore cloud database migration
  • Row Checksum & Data Integrity Verification

    Prove mathematically that source and target databases match before moving a single production customer over.

    • Row count, aggregate sum, and cryptographic hash comparisons per partition
    • Sequence value alignment, constraint validation, and foreign-key checks

    pg_comparator · md5/sha256 row-hash scripts · pg_checksums

  • Shadow Workload Replay & Plan Tuning

    Validate that migrated queries meet or beat source latency before cutover day.

    • Replay representative application queries and compare EXPLAIN ANALYZE plans
    • Pre-cutover index tuning, statistics collection, and PgBouncer pool tests

    pg_stat_statements · EXPLAIN (ANALYZE, BUFFERS) · vacuumdb --analyze-in-stages

    PostgreSQL performance tuning
  • Rehearsed Cutover & Reverse-Sync Rollback

    Execute the production cutover from a minute-by-minute runbook rehearsed on staging, complete with explicit go/no-go gates and fallback paths.

    • Connection drain, LSN zero-lag verification, and sequence advancement
    • Reverse replication or dual-write rollback gate during the hypercare window

    PgBouncer PAUSE/RESUME · pg_stat_subscription · HAProxy

    PostgreSQL major version upgrades

Shared responsibility, SLAs & method comparison

Why automated migration tools still need senior PostgreSQL engineers

Managed cloud databases automate much of the infrastructure layer, but your team still owns query performance, capacity, cost, and incident decisions. 24/7 support. SLA response times: P1 – 15 mins | P2 – 30 mins | P3 – 60 mins.

Migration responsibilities across cloud migration services and JusDB PostgreSQL engineering
Migration PhaseManaged Cloud Targets (RDS, Aurora, Cloud SQL, Azure)Self-Managed Linux or Kubernetes Targets
Heterogeneous schema & PL/SQL / T-SQL conversionCloud migration tools auto-convert basic tables but leave complex packages, triggers, and type edge cases broken. JusDB refactors and tests the code.JusDB runs ora2pg/pgloader, refactors stored procedures into idiomatic PL/pgSQL, and designs target partitioning.
Logical replication lag & source WAL protectionUnmonitored replication slots can fill source storage and halt production. JusDB sets max_slot_wal_keep_size and monitors lag around the clock.JusDB tunes logical decoding workers, wal_sender_timeout, and parallel apply streams so source disks stay safe.
Data integrity, sequence sync & query plan parityDMS or cloud transfer tools move rows without syncing sequences or tuning target query plans. JusDB validates row hashes, sequences, and EXPLAIN plans.JusDB executes chunked checksum verification, sequence advancement scripts, and pre-cutover index optimization.
Cutover choreography & reverse-replication rollbackYour team still owns the cutover runbook. JusDB rehearses the switchover on staging and leads the production cutover bridge.JusDB scripts connection draining, PgBouncer routing switches, and reverse-replication rollback gates.

Your team keeps control

  • Set business priorities, application requirements, and release plans
  • Approve production changes, except routine actions you have pre-approved
  • Own your cloud accounts, access policies, and vendor relationships
  • Decide when maintenance can happen and how quickly service must recover
  • Move the work in-house or to another provider after your agreement's notice period, with your data returned or deleted and the transition help your agreement sets out (Terms, section 8)

JusDB handles the agreed migration engineering

  • Monitor database health, investigate alerts, and involve the right people
  • Review query performance, replication, capacity, and backup health
  • Carry out approved changes and update the operating instructions they affect
  • Report completed work, open risks, and recommended next steps

SLA response times during cutover & hypercare

  • 15 mins

    P1 · Critical

    P1 incidents

  • 30 mins

    P2 · High

    P2 incidents

  • 60 mins

    P3 · Medium

    P3 incidents

SeverityResponse SLADefinitionChannel & coverage
P1 · Critical15 minsProduction database down, primary unreachable, data corruption risk, or active failover event.24/7 · Direct PagerDuty, Opsgenie, or phone page plus incident bridge
P2 · High30 minsSevere latency spike, replication lag climbing rapidly, connection exhaustion, or degraded HA node.24/7 · On-call alert plus shared Slack or Teams channel
P3 · Medium60 minsNon-critical slow query regression, staging issue, backup warning, configuration question, or planned operational request.24/7 · Shared Slack or Teams channel or support ticket

Our engineering team is in India (IST, UTC+5:30) and provides 24/7 support.

Response means an on-call engineer is working the incident, not an automated reply.

Decision or deliverable
JusDB migration scope
Platform or toolYour teamValidation and handover
Migration & Upgrade MethodAssess cross-engine conversion or major-version upgrade paths and document their prerequisites.Determine supported import, upgrade, replication, extension, and access options.Provide source inventory, application requirements, and production approvals.A compatibility assessment and a selected method with tested acceptance criteria.
Heterogeneous Engine ConversionReview data types, schemas, routines, and application behavior; use conversion tools with manual review where needed.Define supported source engines and conversion capabilities for each migration service.Validate business rules, application SQL, and ownership of code changes.Conversion exceptions, application tests, and decisions on unsupported objects.
Data Validation & IntegrityPlan row counts, normalized row hashes, constraints, sequences, and functional checks against agreed criteria.Expose supported data movement and validation facilities; physical page checksums do not compare logical rows across engines.Approve validation coverage and investigate business-data exceptions.Source/target comparison results, exception records, and cutover approval.
Target Platform CompatibilityAssess the target PostgreSQL version, extensions, connectivity, authentication, and operating limits.Control documented platform features and service configuration.Choose the target and approve access, maintenance, and operating costs.Compatibility findings and an agreed target configuration.
Schema ModernizationPropose schema or index changes separately from migration where they alter application behavior.Determine supported data types, extensions, and version features.Approve schema changes and run application regression tests.A reviewed configuration diff, test results, and rollback conditions.
Rollback & HandoverDocument source retention, recovery criteria, and reconciliation of writes after cutover. Test reverse replication only where supported.Provide the supported backup, restore, and replication mechanisms.Approve the recovery decision and assign owners for application reconnect and write reconciliation.A rehearsed recovery plan, validation records, and operating instructions.

Logical cutover choreography

Three-stage logical replication cutover with rollback gate

Step through how we convert schemas, synchronize live transactions with row-level checksum verification, and execute a controlled cutover with a reverse-replication fallback path.

PostgreSQL Logical Migration & Cutover Simulator

Select a migration stage to inspect replication topology, verification checks, and rollback gates.

Data flow & application routing

Source catalog extraction (ora2pg / pgloader) -> Refactored PostgreSQL 17 target

Stage 1 · DDL Translation, Type Mapping & Target Build
  • Oracle / SQL Server / MySQL / Legacy PG

    Source Database

    Extract DDL, packages, triggers, and baseline query latency distributions (ONLINE)

  • ora2pg / pgloader / PL/pgSQL

    Conversion Pipeline

    Convert NUMBER(19) -> BIGINT, packages -> schemas, and partition large heaps (CONVERTED)

  • PostgreSQL 17 Target

    Target Cluster

    Base schema deployed without secondary indexes/FKs to accelerate initial bulk load (READY)

The target PostgreSQL schema, types, partitions, and stored procedures are converted and benchmarked while the legacy database continues serving production untouched.

Representative migration runbook deliverable

Native PostgreSQL logical replication setup, LSN lag check, and sequence sync SQL

Below is an excerpt from a production PostgreSQL logical cutover runbook showing publication/subscription wiring, byte-exact LSN lag verification, and automated sequence synchronization.

Logical Replication Cutover Runbook SpecimenSample deliverable

Production Cutover Gate

3.2 TB transactional database migrated with 48-second application write pause

Initial parallel table copy and index creation ran online over 18 hours while the source served full traffic. At cutover, PgBouncer PAUSE held client connections for 48 seconds while logical replication drained to 0 bytes lag and sequences were synchronized.

Write pause window48 sec at cutover
Row hash drift0 rows

1. Native logical publication & parallel-streaming subscription

-- On Source Primary: verify REPLICA IDENTITY and create publication
SELECT n.nspname, c.relname
FROM pg_class c JOIN pg_namespace n ON n.oid = c.relnamespace
WHERE c.relkind = 'r' AND n.nspname = 'public' AND c.relreplident = 'd'
  AND NOT EXISTS (SELECT 1 FROM pg_constraint k WHERE k.conrelid = c.oid AND k.contype = 'p');

CREATE PUBLICATION pub_migration_all FOR ALL TABLES
  WITH (publish_via_partition_root = true);

-- On Target PostgreSQL 17: stream in-progress transactions in parallel
CREATE SUBSCRIPTION sub_migration_cutover
  CONNECTION 'host=10.24.1.10 port=5432 dbname=app_prod user=repl_migrator sslmode=verify-full'
  PUBLICATION pub_migration_all
  WITH (copy_data = true, streaming = parallel, synchronous_commit = off);

2. Zero-byte LSN lag gate & sequence synchronization at cutover

-- Verify replication slot has drained to 0 bytes before switching traffic
SELECT slot_name, active,
       pg_wal_lsn_diff(pg_current_wal_lsn(), confirmed_flush_lsn) AS lag_bytes
FROM pg_replication_slots WHERE slot_name = 'sub_migration_cutover';

-- Synchronize all target sequences to table MAX(id) + safety buffer
SELECT format(
  'SELECT setval(%L, COALESCE((SELECT MAX(%I) FROM %I.%I), 1) + 1000, true);',
  pg_get_serial_sequence(format('%I.%I', table_schema, table_name), column_name),
  column_name, table_schema, table_name
)
FROM information_schema.columns
WHERE table_schema = 'public'
  AND pg_get_serial_sequence(format('%I.%I', table_schema, table_name), column_name) IS NOT NULL;

Ways to engage

Start with a readiness audit, a full migration, or post-cutover DBA care

Engage JusDB for a free single-instance migration readiness review, an end-to-end migration and cutover project, or ongoing Remote DBA and 24/7 support.

Turnkey migration projectThis page

End-to-end migration & logical cutover.

Fixed-scope project covering schema conversion, CDC/logical replication setup, checksum verification, staging rehearsal, and production cutover.

Migration tracks we execute end to end

  • Oracle to PG (ora2pg)
  • SQL Server to PG
  • MySQL to PG (pgloader)
  • Logical replication
  • PG 17 major upgrades
Free readiness audit

Free 1-instance migration readiness check.

We inspect your source schema, extensions, data types, and replication prerequisites on one instance and deliver a migration feasibility report.

Evaluated before you commit to a timeline

  • Schema, PK & REPLICA IDENTITY check
  • Stored procedure & type conversion scope
  • Recommended cutover strategy & window
Post-cutover operations

Remote DBA & 24/7 Hypercare Support.

After cutover, hand over ongoing vacuum care, query tuning, pgBackRest backups, and 15-minute P1 incident response.

  1. 15m P124/7 response SLA
  2. Plan Tuningpost-cutover SQL
  3. Rollback Gatereverse sync ready

Target PostgreSQL platforms we migrate onto

For procurement and security

Mutual NDA first, rehearsed cutover runbooks, and explicit rollback gates

Database migrations succeed when nothing on cutover night is improvised. Your team approves every rehearsal milestone, checksum verification report, and go/no-go gate.Raguraman, Head of DBSRE · Allen D, Principal Engineer
  • Mutual NDA
  • Written migration SOW
  • Named senior engineers
  • Verified row checksums
  • NDA before discovery

    Signed before any schema or catalog inspection. Scoping calls require no credentials.

  • Minute-by-minute cutover plan

    Every command, owner, timing budget, and rollback trigger documented and rehearsed on staging first.

  • Encrypted replication channels

    Logical replication and CDC streams run over VPC peering, PrivateLink, or TLS-verified tunnels with least-privilege roles.

  • Full handover to your team

    All converted DDL, PL/pgSQL code, validation scripts, and operational runbooks belong to your organization. Meet the JusDB team.

JusDB's security practices are aligned with ISO 27001 and SOC 2 Type II, and JusDB is pursuing both certifications (see Terms, section 12). Read the stated status.

PostgreSQL migration FAQ

Common questions about PostgreSQL migration services

Answers on Oracle to PostgreSQL (ora2pg), MySQL to PostgreSQL (pgloader), logical replication cutovers, sequence sync, row checksums, and rollback gates.

How do you migrate from Oracle to PostgreSQL using ora2pg and CDC?

We start by running ora2pg against your Oracle catalog to score migration complexity and extract tables, views, sequences, packages, and triggers. We map Oracle data types (such as NUMBER, DATE, VARCHAR2, and CLOB/BLOB) to optimal PostgreSQL types, refactor PL/SQL packages and triggers into PL/pgSQL, and use orafce where compatibility functions shorten application changes. For live cutovers, we combine a parallel initial snapshot load with Change Data Capture (Debezium or AWS DMS) so the final cutover window only requires draining in-flight transactions.

How do you keep downtime minimal during a PostgreSQL migration?

Instead of offline pg_dump and pg_restore windows that scale with database size, we use logical replication (native CREATE PUBLICATION / CREATE SUBSCRIPTION or pglogical) or CDC pipelines. The target PostgreSQL cluster is built, loaded, indexed, and continuously synchronized while the source database remains online. Once replication lag reaches zero bytes and row checksums pass, we pause writes via PgBouncer, synchronize sequence values, and switch application routing in a rehearsed maintenance window.

What is the difference between this page, Cloud Migration, and Major Version Upgrades?

This page (/databases/postgresql/migration) covers heterogeneous database migrations (Oracle, SQL Server, and MySQL to PostgreSQL) and cross-environment logical replication cutovers. If you are moving existing PostgreSQL clusters specifically onto AWS RDS, Aurora, Google Cloud SQL, or Azure Flexible Server, see our dedicated PostgreSQL Cloud Migration page (/databases/postgresql/cloud-migration). If you are upgrading PostgreSQL 12, 13, or 14 to PostgreSQL 16 or 17, see our PostgreSQL Upgrades page (/databases/postgresql/upgrades).

How do you migrate MySQL or MariaDB workloads to PostgreSQL?

We use pgloader and custom transformation rules to stream MySQL schemas and data into PostgreSQL, automatically converting MySQL data types (such as TINYINT(1) to boolean, UNSIGNED integers to wider types, and AUTO_INCREMENT to GENERATED BY DEFAULT AS IDENTITY) and sanitizing invalid MySQL zero-dates. Alongside data migration, we help your developers refactor MySQL-specific SQL syntax (such as INSERT ... ON DUPLICATE KEY UPDATE to INSERT ... ON CONFLICT) and tune PostgreSQL indexes.

How is data integrity verified between the source database and PostgreSQL?

We never rely solely on row counts. Before cutover, we run automated verification scripts that compare per-table and per-partition row counts, numeric column sums/min/max bounds, and chunked cryptographic row hashes (MD5/SHA-256) normalized across source and target data types. We also verify all sequence last_value positions, NOT NULL and CHECK constraints, and foreign-key integrity.

Why do PostgreSQL sequences break after logical replication, and how do you fix them?

PostgreSQL native logical replication (CREATE PUBLICATION / CREATE SUBSCRIPTION) streams table DML changes (INSERT, UPDATE, DELETE) but does not replicate sequence advances. If applications cut over without advancing target sequences, the first new INSERT fails with a duplicate primary key error. Our cutover runbook automatically queries MAX(id) or source sequence states during the brief write freeze and executes setval() across every sequence before opening target traffic.

What happens if an application issue appears after the migration cutover?

Every production migration we design includes a rehearsed rollback gate with explicit go/no-go timestamps. Where supported by the topology, we configure reverse logical replication or reverse CDC from the new PostgreSQL primary back to the legacy source database before cutover. If an unexpected application regression occurs during the hypercare window, we can switch traffic back without losing transactions committed after cutover.

What support is available during and after a PostgreSQL migration?

24/7 support. SLA response times: P1 – 15 mins | P2 – 30 mins | P3 – 60 mins. During cutover windows and post-migration hypercare, engineering coverage is 24/7, with a 15-minute P1 response SLA.

Related migration tracks & comparisons

Explore cloud migrations, major upgrades, and engine comparisons

Compare Oracle and MySQL against PostgreSQL, or explore dedicated tracks for cloud re-platforming and major version upgrades.

Next step

Plan your PostgreSQL migration with a rehearsed cutover

Tell us your source database engine, dataset size, and allowed cutover window. The first 30-minute call covers your databases, current ownership, and required coverage. No production access is needed. Or request a free audit of one database instance, subject to availability: mutual NDA before read-only access, a prioritized report within one week after access is ready, and no obligation.

Mutual NDA before access · verified row checksums · explicit rollback gates