Environment Variables
The environment variables required to run each MySQL to MariaDB Migrator mode, plus the common source, target, and optional tuning variables.
The migrator reads its configuration from environment variables (or the configuration file it writes from your interactive answers). This page lists the variables required to run each mode. A complete reference of every variable, with defaults and descriptions, ships with the tool.
Common Variables
Most modes share the same source and target connection variables:
SRC_HOST, SRC_PORT
Source MySQL host and port.
SRC_ADMIN_USER, SRC_ADMIN_PASS
Source admin credentials.
SRC_DB or SRC_DBS
A single source database, or a comma-separated list.
TGT_HOST, TGT_PORT
Target MariaDB host and port.
TGT_ADMIN_USER, TGT_ADMIN_PASS
Target admin credentials.
SRC_SSL_MODE
Optional source TLS mode (DISABLED, PREFERRED, REQUIRED, VERIFY_CA, or VERIFY_IDENTITY) for TLS-required sources.
Serial Streaming Copy (one_step)
Requires the common source and target variables above. Optional:
ANALYZE_TARGET—1by default; runsANALYZE TABLEon the target after the load to refresh optimizer statistics. Set to0to skip. (Applies toone_step,two_step, andstaged.)
Parallel Restartable Streaming Copy (two_step)
Requires the common source and target variables. Optional:
SQLINESDATA_BIN— full path to themariadb-mtkbinary; auto-detected from asqldataorsqlinesdatabinary onPATH.MIGRATOR_SKIP_ROWCOUNT_VALIDATE— set to1to skip the post-load row-count validation.
Replication (binlog)
Requires the common source and target variables, plus:
REPL_USER,REPL_PASS— replication credentials.
Optional:
SRC_BINLOG_FILE,SRC_BINLOG_POS— binlog coordinates; auto-captured during the seed if not set.BINLOG_COORD_FILE— where captured coordinates are written (default:artifacts/binlog_coords.env).BINLOG_MAX_LAG_SECS— replication lag threshold in seconds (default:30).
Offline Copy (staged)
The phase selector and connection requirements depend on the phase:
STAGED_PHASE—dump_and_load(default),dump_only, orload_only.Source variables are required for
dump_and_loadanddump_only.Target variables are required for
dump_and_loadandload_only.
Dump and load tuning (all optional):
STAGED_DUMP_DIR
run directory
Dump location; required for load_only to point at the manifest directory.
STAGED_COMPRESS
1
Gzip-compress the dump.
STAGED_PV
1
Show a progress meter through pv or the fallback probe.
STAGED_PARALLEL
4
Concurrent per-database dumps.
STAGED_LOAD_PARALLEL
1
Concurrent per-database loads.
STAGED_VERIFY_CHECKSUM
1
Verify each dump file's integrity before load.
STAGED_DISK_HEADROOM_FACTOR
2
Multiplier on the source data size for the free-space check.
STAGED_FINALIZE_VARIANCE_PCT
50
Row-count variance threshold above which finalize warns.
STAGED_CONFIRM_OFFLINE
—
Set to bypass the interactive offline-acknowledgment prompt for non-interactive runs.
Run-Control Variables
These apply across modes:
MODE
Selects the mode (one_step, two_step, staged, or binlog) for non-interactive runs.
ALLOW_TARGET_DB_OVERWRITE
Set to 1 to allow migrating into an existing target database.
ALLOW_ROOT_USERS
Set to 1 to allow root as a source or target admin user.
FORCE_NEW_RUN
Set to 1 to force a fresh run instead of resuming a previous one.
This page is licensed: CC BY-SA / Gnu FDL
Last updated
Was this helpful?

