Migration Tasks
MigratorXpress organizes migrations into discrete tasks. You specify which tasks to run with the --task_list parameter, and MigratorXpress executes them in the order listed. Use --task_list all as a shortcut for the full sequence.
Available Tasks
| Task | Description | When to Use |
|---|---|---|
translate | Convert source DDL to the target platform's SQL dialect | First step of any migration |
create | Create tables in the target database using the translated DDL | After translation |
transfer | Copy data from source to target (requires FastTransfer) | After tables are created |
diff | Validate data integrity by comparing row counts between source and target | After transfer |
copy_pk | Copy primary key constraints to the target database | After transfer |
copy_ak | Copy alternate key (unique) constraints to the target database | After primary keys |
copy_fk | Copy foreign key constraints to the target database | After all other keys |
Task Dependencies and Recommended Order
Tasks should follow a logical sequence. Running them out of order will cause failures -- for example, transfer fails if the target tables do not exist yet.
Recommended full migration order:
translate → create → transfer → diff → copy_pk → copy_ak → copy_fk
The diff task is optional but recommended. It provides a quick sanity check before committing to constraint creation.
Constraint copying (copy_pk, copy_ak, copy_fk) is currently supported only for Oracle to SQL Server migrations. For other migration paths, create constraints manually on the target database after the data transfer.
Common Task Combinations
Full Migration
Translate the schema, create tables, transfer data, and validate:
--task_list translate create transfer diff
Schema Only
Translate and create tables without transferring data. Useful for validating the DDL translation before committing to a full migration:
--task_list translate create
Data Only
Transfer data into existing tables. The schema must already exist in the target database:
--task_list transfer
Data Append (Load Mode)
Transfer data without dropping or truncating existing tables. Use --load_mode append to insert rows into existing tables:
--task_list transfer --load_mode append
Constraints Only
Copy constraints after a successful data transfer. Run this as a separate step to avoid constraint violations during the initial load:
--task_list copy_pk copy_ak copy_fk
Migration Database Modes
The --drop_tables_if_exists parameter controls how MigratorXpress handles existing tables in the target database:
| Value | Behavior |
|---|---|
true | Drop and recreate target tables before migration |
false | Fail if target tables already exist (default) |
For iterative development and testing, --drop_tables_if_exists true is convenient. For production migrations, leave it as false and manage table lifecycle explicitly.
Resume Functionality
If a migration fails partway through, you can resume from the point of failure instead of starting over:
./MigratorXpress --auth ./credentials.json \
--source_db_auth_id oracle_prod \
--source_db_name ORCL \
--target_db_auth_id postgres_dev \
--target_db_name tpch \
--migration_db_auth_id ms_mig_log \
--resume 20260203-cf5be0ac-159f-4dad-861e-8b2b6f3868d7
MigratorXpress skips tasks and tables that already completed successfully and resumes from the first incomplete item. Since v0.6.22, you do not need to specify --task_list or --source_schema_name when resuming -- they are retrieved automatically from the migration database.
The run ID is displayed in the console output when the migration starts (format: YYYYMMDD-{uuid}). You can also query the migration tracking database to find it.
Full Example
A complete Oracle-to-PostgreSQL migration in two steps -- first data, then constraints:
# Step 1: Schema, data, and validation
./MigratorXpress --auth ./credentials.json \
--source_db_auth_id oracle_prod \
--source_schema_name SALES \
--target_db_auth_id postgres_dev \
--target_schema_name sales \
--migration_db_auth_id ms_mig_log \
--n_jobs 4 \
--fasttransfer_p 2 \
--drop_tables_if_exists true \
--task_list translate create transfer diff
# Step 2: Constraints (after verifying diff results)
./MigratorXpress --auth ./credentials.json \
--source_db_auth_id oracle_prod \
--source_schema_name SALES \
--target_db_auth_id postgres_dev \
--target_schema_name sales \
--migration_db_auth_id ms_mig_log \
--task_list copy_pk copy_ak copy_fk
See Also
- FastTransfer Configuration -- Parallel transfer tuning and performance
- Database Connections -- Auth file configuration
- Quick Start Guide -- Getting started with MigratorXpress
- CLI Reference -- Full command-line reference