Command Line Reference

Every switch, with examples. Drop-in compatible with pg_replicator.py.

Basic Usage

replicator-ng [OPTIONS]

Configuration & Source

FlagDescription
-c, --config FILEPath to config file (TOML or YAML). Default: replicatorconfig.yaml
-s, --source FILEPath to Access database (.accdb/.mdb). Overrides config
-o, --output FILEGenerate a starter config file from an Access database

Target Overrides

FlagDescription
--thost HOSTTarget host (overrides config)
--tport PORTTarget port (overrides config)
--tdatabase DBTarget database name (overrides config)
--tuser USERTarget username (overrides config)
--tpassword PASSTarget password (overrides config)

Help & Version

FlagDescription
-h, --helpPrint help information listing all flags and options
-V, --versionPrint version number (e.g. replicator-ng 0.1.0)

Verbosity

FlagDescription
-v, --verboseINFO-level logging
--debugDEBUG-level logging (very detailed)
--traceTRACE-level logging (everything)
--silentNo 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)

FlagDescription
-S, --schemaCreate/replace schema only — no data copy. Creates the database if it doesn't exist
--full-refreshFull data copy — drops and recreates all rows
--adjust-ms-accessAdd missing indexes to Access to support FK relationships
-l, --listList tables in the Access database with row counts
-n, --networkTest MS Access and PostgreSQL connections
--dumpDump schema and foreign keys to stdout

Only one mode flag can be used at a time.

Sync Options

FlagDescription
--sync-deletedDetect and delete rows in PostgreSQL that no longer exist in Access
--nonvolatileSkip tables marked as nonvolatile when their row counts haven't changed
--slowProcess all tables regardless of count comparison (used with --sync-deleted)
-a, --no-auto-indexSkip automatic index creation on FK columns

Naming & Views

FlagDescription
--simple-namesUse lowercase table/column names without quoted identifiers. Must be used with --schema
--create-viewsCreate 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

CodeMeaning
0Success
1Configuration error (bad config, missing file, invalid flag combination)
2Connection error (can't reach Access or PostgreSQL)
3Replication error (data copy or schema creation failed)
4Validation 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.