Skip to main content

Ready to use Progress to PostgreSQL database mirroring tool

Project description

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

oe2pg-1.0.0.tar.gz (26.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

oe2pg-1.0.0-py3-none-any.whl (32.2 kB view details)

Uploaded Python 3

File details

Details for the file oe2pg-1.0.0.tar.gz.

File metadata

  • Download URL: oe2pg-1.0.0.tar.gz
  • Upload date:
  • Size: 26.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.2

File hashes

Hashes for oe2pg-1.0.0.tar.gz
Algorithm Hash digest
SHA256 7c4fa3aaa0279f42f0bc97f2681f1e0eb6caba4b54ecbaf45d971869b0545956
MD5 2319a542552cf8e02747b9992bace3da
BLAKE2b-256 becadfff600fe3881f8c7393cfed802956edd6ad5982bb0c69942cf3f4006bea

See more details on using hashes here.

File details

Details for the file oe2pg-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: oe2pg-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 32.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.2

File hashes

Hashes for oe2pg-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9d5c39beaa6bc0bb1d8bb19b2b44723226ab255c8afd995f5f35bdbd38e74f0e
MD5 c460beffe62beaba5c3a836d9e7ae9ae
BLAKE2b-256 53be3731111cb39286a188cafc99afd72f4d148f837436ae5d0acd5cb1f64d4f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page