Skip to main content

OpenEdge 2 PostgreSQL Mirroring Tool

Enterprise-grade tool for mirroring Progress OpenEdge databases to PostgreSQL with support for:

  • Initial full sync and incremental delta updates
  • Row count verification and discrepancy repair
  • Parallel processing for large tables
  • Comprehensive tracking and error recovery
  • Authorization error handling (we just ignore the table, kek)

ASCII lettering made with: Patorjk

Install from PyPi with

pip install oe2pg

To get started ...

  1. Create a configuration file (config.json):
{
    "progress_db": {
        "host": "your-progress-host",
        "port": 1234,
        "db_name": "your_db",
        "user": "your_user", 
        "password": "your_password",
        "schema": "PUB",
        "jar_file": "path/to/openedge.jar",
        "driver_class": "com.ddtek.jdbc.openedge.OpenEdgeDriver"
    },
    "postgres_db": {
        "conn_string": "postgresql://user:password@host:5432/dbname",
        "pool_min_conn": 5,
        "pool_max_conn": 20
    },
    "mirror_settings": {
        "batch_size": 1000,
        "max_workers": 4,
        "max_cursors": 50,
        "log_file": "/var/log/db_mirror.log"
    }
}
  1. Initial setup (first run): oe2pg --config config.json --first-run

  2. Regular syncs: oe2pg --config config.json

  3. Repair discrepancies: oe2pg --config config.json --repair

Cron Example

I recommend using this tool well away from peak load times, via cron, and ideally after any of your ETL imports occur. Our third parties run theirs during business hours, so this is a general cron example:

Daily sync at 1am: 0 1 * * * /usr/local/bin/oe2pg --config /etc/oe2pg/config.json >> /var/log/oe2pg-cron.log 2>&1

Tracking features

By default the program initiates a delta sync. This was designed on an older database built on Progress 11.7, and updated for 12.3, but the underlying data structure was not updated, therefore I have taken the following steps for keep track up updates:

  1. Delta Sync Feature
  • Get last known state (PK, hash, row count)
  • Fetch that row from Progress by PK
  • Compute hash and compare
  • If hash matches:
    • Proceed with normal delta sync (PK > last_pk)
  • If hash doesn't match:
    • Binary search backwards to find divergence point
    • Upsert all rows from divergence point forward
  1. Binary Search Feature:
  • Start with current row, go back by powers of 2
  • When hash matches, narrow down to find exact divergence point
  • This efficiently handles cases where changes occur near the end
  1. Upsert Strategy:
  • For tables with PKs: Use INSERT ... ON CONFLICT UPDATE
  • For tables without PKs: Continue with full sync approach

Release files for oe2pg 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for oe2pg 1.0.0
File Size Uploaded
oe2pg-1.0.0.tar.gz 26.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for oe2pg 1.0.0
File Interpreter ABI Platform
oe2pg-1.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 59.0 kB

Release files / oe2pg-1.0.0.tar.gz

Download URL oe2pg-1.0.0.tar.gz
Size 26.8 kB
Tags Source
SHA-256 checksum
How to use checksums
7c4fa3aaa0279f42f0bc97f2681f1e0eb6caba4b54ecbaf45d971869b0545956
BLAKE2b-256 checksum
How to use checksums
becadfff600fe3881f8c7393cfed802956edd6ad5982bb0c69942cf3f4006bea
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.2

Release files / oe2pg-1.0.0-py3-none-any.whl

Download URL oe2pg-1.0.0-py3-none-any.whl
Size 32.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9d5c39beaa6bc0bb1d8bb19b2b44723226ab255c8afd995f5f35bdbd38e74f0e
BLAKE2b-256 checksum
How to use checksums
53be3731111cb39286a188cafc99afd72f4d148f837436ae5d0acd5cb1f64d4f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.2

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page