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 ...
- 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"
}
}
-
Initial setup (first run):
oe2pg --config config.json --first-run -
Regular syncs:
oe2pg --config config.json -
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:
- 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
- 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
- Upsert Strategy:
- For tables with PKs: Use INSERT ... ON CONFLICT UPDATE
- For tables without PKs: Continue with full sync approach
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7c4fa3aaa0279f42f0bc97f2681f1e0eb6caba4b54ecbaf45d971869b0545956
|
|
| MD5 |
2319a542552cf8e02747b9992bace3da
|
|
| BLAKE2b-256 |
becadfff600fe3881f8c7393cfed802956edd6ad5982bb0c69942cf3f4006bea
|
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9d5c39beaa6bc0bb1d8bb19b2b44723226ab255c8afd995f5f35bdbd38e74f0e
|
|
| MD5 |
c460beffe62beaba5c3a836d9e7ae9ae
|
|
| BLAKE2b-256 |
53be3731111cb39286a188cafc99afd72f4d148f837436ae5d0acd5cb1f64d4f
|