Basic Usage
replicator-ng [OPTIONS]
Configuration & Source
| Flag | Description |
-c, --config FILE | Path to config file (TOML or YAML). Default: replicatorconfig.yaml |
-s, --source FILE | Path to Access database (.accdb/.mdb). Overrides config |
-o, --output FILE | Generate a starter config file from an Access database |
Target Overrides
| Flag | Description |
--thost HOST | Target host (overrides config) |
--tport PORT | Target port (overrides config) |
--tdatabase DB | Target database name (overrides config) |
--tuser USER | Target username (overrides config) |
--tpassword PASS | Target password (overrides config) |
Help & Version
| Flag | Description |
-h, --help | Print help information listing all flags and options |
-V, --version | Print version number (e.g. replicator-ng 0.1.0) |
Verbosity
| Flag | Description |
-v, --verbose | INFO-level logging |
--debug | DEBUG-level logging (very detailed) |
--trace | TRACE-level logging (everything) |
--silent | No console output. Logs to %APPDATA%\ReplicatorNG\logs\ with daily rotation. Exit codes: 0=ok, 1=config, 2=connection, 3=replication, 4=validation |
Modes (mutually exclusive)
| Flag | Description |
-S, --schema | Create/replace schema only — no data copy. Creates the database if it doesn't exist |
--full-refresh | Full data copy — drops and recreates all rows |
--adjust-ms-access | Add missing indexes to Access to support FK relationships |
-l, --list | List tables in the Access database with row counts |
-n, --network | Test MS Access and PostgreSQL connections |
--dump | Dump schema and foreign keys to stdout |
Only one mode flag can be used at a time.
Sync Options
| Flag | Description |
--sync-deleted | Detect and delete rows in PostgreSQL that no longer exist in Access |
--nonvolatile | Skip tables marked as nonvolatile when their row counts haven't changed |
--slow | Process all tables regardless of count comparison (used with --sync-deleted) |
-a, --no-auto-index | Skip automatic index creation on FK columns |
Naming & Views
| Flag | Description |
--simple-names | Use lowercase table/column names without quoted identifiers. Must be used with --schema |
--create-views | Create sane views on the PostgreSQL database after schema creation |
Examples
# List tables
replicator-ng -l -s "C:\data\MyDB.accdb"
# Test connections
replicator-ng -c myconfig.toml --network
# Full replication
replicator-ng -c myconfig.toml --full-refresh
# Schema only with simple names
replicator-ng -c myconfig.toml --schema --simple-names
# Sync changes + detect deletions
replicator-ng -c myconfig.toml --sync-deleted --nonvolatile
# Silent scheduled run (no console, log to file)
replicator-ng --silent -c myconfig.toml --full-refresh
Exit Codes
| Code | Meaning |
| 0 | Success |
| 1 | Configuration error (bad config, missing file, invalid flag combination) |
| 2 | Connection error (can't reach Access or PostgreSQL) |
| 3 | Replication error (data copy or schema creation failed) |
| 4 | Validation failure (row counts don't match) |
🔄 Python compatibility: Every flag from pg_replicator.py is ported. Replace python pg_replicator.py with replicator-ng — same flags, same output.