Skip to main content
This page lists the commands and the flags that you can use to configure a MOLT Fetch command execution.

Commands

CommandUsage
fetchStart the fetch task. This loads data from a source database to a target CockroachDB database.

Subcommands

CommandUsage
tokens listList active .

Flags

Global flags

FlagDescription
--source(Required) Connection string used to connect to the Oracle PDB (in a CDB/PDB architecture) or to a standalone database (non‑CDB). For details, refer to .
--source-cdbConnection string for the Oracle container database (CDB) when using a multitenant (CDB/PDB) architecture. Omit this flag on a non‑multitenant Oracle database. For details, refer to .
--target(Required) Connection string for the target database. For details, refer to .
--allow-tls-mode-disableAllow insecure connections to databases. Secure SSL/TLS connections should be used by default. This should be enabled only if secure SSL/TLS connections to the source or target database are not possible.
--assume-roleService account to use for assume role authentication. --use-implicit-auth must be included. For example, --assume-role='user-test@cluster-ephemeral.iam.gserviceaccount.com' --use-implicit-auth. For details, refer to .
--bucket-pathThe path within the bucket where intermediate files are written (e.g., 's3://bucket/path' or 'gs://bucket/path'). Only the URL path is used; query parameters (e.g., credentials) are ignored. To pass in query parameters, use the appropriate flags: --assume-role, --import-region, --use-implicit-auth.
--case-sensitiveToggle case sensitivity when comparing table and column names on the source and target. To disable case sensitivity, set --case-sensitive=false. If = is not included (e.g., --case-sensitive false), the flag is interpreted as --case-sensitive (i.e., --case-sensitive=true).

Default: false
--cleanupWhether to delete intermediate files after moving data using . Note: Cleanup does not occur on .
--compressionCompression method for data when using (gzip/none).

Default: gzip
--continuation-file-nameRestart fetch at the specified filename if the task encounters an error. --fetch-id must be specified. For details, see .
--continuation-tokenRestart fetch at a specific table, using the specified continuation token, if the task encounters an error. --fetch-id must be specified. For details, see .
--crdb-pts-durationThe duration for which each timestamp used in data export from a CockroachDB source is protected from garbage collection. This ensures that the data snapshot remains consistent. For example, if set to 24h, each timestamp is protected for 24 hours from the initiation of the export job. This duration is extended at regular intervals specified in --crdb-pts-refresh-interval.

Default: 24h0m0s
--crdb-pts-refresh-intervalThe frequency at which the protected timestamp’s validity is extended. This interval maintains protection of the data snapshot until data export from a CockroachDB source is completed. For example, if set to 10m, the protected timestamp’s expiration will be extended by the duration specified in --crdb-pts-duration (e.g., 24h) every 10 minutes while export is not complete.

Default: 10m0s
--direct-copyEnables , which copies data directly from source to target without using an intermediate store.
--export-concurrencyNumber of shards to export at a time per table, each on a dedicated thread. This controls how many shards are created for each individual table during the and is distinct from --table-concurrency, which controls how many tables are processed simultaneously. The total number of concurrent threads is the product of --export-concurrency and --table-concurrency. Tables can be sharded with a range-based or stats-based mechanism. For details, refer to .

Default: 4
--export-retry-max-attemptsMaximum number of retry attempts for source export queries when connection failures occur. Only supported for PostgreSQL and CockroachDB sources.

Default: 3
--export-retry-max-durationMaximum total duration for retrying source export queries. If 0, no time limit is enforced. Only supported for PostgreSQL and CockroachDB sources.

Default: 5m0s
--filter-pathPath to a JSON file defining row-level filters for the . Refer to .
--fetch-idRestart fetch task corresponding to the specified ID. If --continuation-file-name or --continuation-token are not specified, fetch restarts for all failed tables.
--flush-rowsNumber of rows before the source data is flushed to intermediate files. Note: If --flush-size is also specified, the fetch behavior is based on the flag whose criterion is met first.
--flush-sizeSize (in bytes) before the source data is flushed to intermediate files. Note: If --flush-rows is also specified, the fetch behavior is based on the flag whose criterion is met first.
--ignore-replication-checkSkip querying for replication checkpoints such as pg_current_wal_insert_lsn() on PostgreSQL, gtid_executed on MySQL, and CURRENT_SCN on Oracle. This option is intended for use during bulk load migrations or when doing a one-time data export from a read replica.
--import-batch-sizeThe number of files to be imported at a time to the target database during the . This applies only when using for data movement. Note: Increasing this value can improve the performance of full-scan queries on the target database shortly after fetch completes, but very high values are not recommended. If any individual file in the import batch fails, you must the entire batch.

Default: 1000
--import-regionThe region of the bucket. This applies only to . Set this flag only if you need to specify an AWS_REGION explicitly when using for data movement. For example, --import-region=ap-south-1.
--local-pathThe path within the where intermediate files are written (e.g., data/migration/cockroach). --local-path-listen-addr must be specified.
--local-path-crdb-access-addrAddress of a that is publicly accessible. This flag is only necessary if CockroachDB cannot reach the local address specified with --local-path-listen-addr (e.g., when moving data to a CockroachDB Cloud deployment). --local-path and --local-path-listen-addr must be specified.

Default: Value of --local-path-listen-addr.
--local-path-listen-addrWrite intermediate files to a at the specified address (e.g., 'localhost:3000'). --local-path must be specified.
--log-fileWrite messages to the specified log filename. If no filename is provided, messages write to fetch-{datetime}.log. If "stdout" is provided, messages write to stdout.
--loggingLevel at which to log messages (trace/debug/info/warn/error/fatal/panic).

Default: info
--metrics-listen-addrAddress of the Prometheus metrics endpoint, which has the path {address}/metrics. For details on important metrics to monitor, refer to .

Default: '127.0.0.1:3030'
--modeConfigure the MOLT Fetch behavior: data-load, export-only, or import-only. For details, refer to .

Default: data-load
--non-interactiveRun the fetch task without interactive prompts. This is recommended only when running molt fetch in an automated process (i.e., a job or continuous integration).
--opt-out-telemetrySuppress MOLT telemetry-event logging, which is enabled by default.
--pglogical-replication-slot-nameName of a PostgreSQL replication slot that will be created before taking a snapshot of data. Must match the slot name specified with --slotName in the . For details, refer to .
--pglogical-publication-and-slot-drop-and-recreateDrop the PostgreSQL publication and replication slot if they exist, then recreate them. Creates a publication named molt_fetch and the replication slot specified with --pglogical-replication-slot-name. For details, refer to .

Default: false
--pprof-listen-addrAddress of the pprof endpoint.

Default: '127.0.0.1:3031'
--row-batch-sizeNumber of rows per shard to export at a time. For details on sharding, refer to . See also .

Default: 100000
--schema-filterMove schemas that match a specified regular expression.

Default: '.*'
--skip-pk-checkSkip primary-key matching to allow data load when source or target tables have missing or mismatched primary keys. Disables sharding and bypasses --export-concurrency and --row-batch-size settings. Refer to .

Default: false
--table-concurrencyNumber of tables to export at a time. The number of concurrent threads is the product of --export-concurrency and --table-concurrency.

Default: 4
--table-exclusion-filterExclude tables that match a specified POSIX regular expression.

This value cannot be set to '.*', which would cause every table to be excluded.

Default: Empty string
--table-filterMove tables that match a specified POSIX regular expression.

Default: '.*'
--table-handlingHow tables are initialized on the target database (none/drop-on-target-and-recreate/truncate-if-exists). For details, see .

Default: none
--transformations-filePath to a JSON file that defines transformations to be performed on the target schema during the fetch task. Refer to .
--type-map-filePath to a JSON file that contains explicit type mappings for automatic schema creation, when enabled with --table-handling drop-on-target-and-recreate. For details on the JSON format and valid type mappings, see .
--use-console-writerUse the console writer, which has cleaner log output but introduces more latency.

Default: false (log as structured JSON)
--use-copyUse to move data. This makes tables queryable during data load, but is slower than using IMPORT INTO. For details, refer to .
--use-implicit-authUse for URIs.
--use-stats-based-shardingEnable statistics-based sharding for PostgreSQL sources. This allows sharding of tables with primary keys of any data type and can create more evenly distributed shards compared to the default numerical range sharding. Requires PostgreSQL 11+ and access to pg_stats. For details, refer to .

tokens list flags

FlagDescription
--conn-string(Required) Connection string for the target database. For details, see .
-n, --num-resultsNumber of results to return.

See also