A command-line tool to efficiently and securely sync data between PostgreSQL databases with parallel transfers and data masking.
pgsync is a command-line tool that synchronizes data from one PostgreSQL database to another. It solves the problem of safely and efficiently migrating or replicating data between databases, especially when dealing with sensitive information, schema differences, or large datasets. Unlike basic dump/restore utilities, it offers parallel transfers, data masking, and fine-grained control over what gets synced.
Developers, database administrators, and DevOps engineers who need to move data between PostgreSQL instances for staging, testing, reporting, or migration purposes.
Developers choose pgsync for its balance of speed, security, and flexibility—it handles real-world complexities like partial syncs and data anonymization out-of-the-box, while being simpler to configure than custom ETL scripts.
Sync data from one Postgres database to another
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Syncs tables concurrently for faster data migration, as highlighted in the README with benchmarks and options like --jobs for control.
Offers data_rules in .pgsync.yml to prevent sensitive data leakage, using methods like unique_email or random_date to anonymize columns.
Gracefully handles schema differences such as missing or extra columns between databases, avoiding common sync failures.
Allows syncing specific rows with WHERE clauses or related records via groups, ideal for testing subsets without full database copies.
Supports resumable batches for append-only tables with numeric primary keys, enabling efficient backfills and handling of massive datasets.
Exclusively works with PostgreSQL databases, making it unsuitable for heterogeneous database environments or migrations to other systems.
Requires manual intervention for foreign keys, such as deferring constraints or syncing tables sequentially, which can be error-prone and slow.
Installation depends on Ruby and libpq, adding setup complexity in environments not already using Ruby or requiring additional system packages.
While it handles schema differences, it doesn't automate schema migrations; users must rely on external tools or manual steps for schema changes.