Examples and use cases
Complete command examples for the supported migration paths, plus advanced scenarios. Each example assumes a credentials.json file with these entries (see the Quick Start Guide and Database Connections):
| Auth ID | Role | ds_type | database |
|---|---|---|---|
oracle_prod | Source | oracle | ORCLPDB1 |
postgres_prod | Source | postgres | analytics |
mssql_source | Source | mssql | SourceDB |
netezza_source | Source | netezza | PROD_DB |
mssql_target | Target | mssql | target_db |
pg_target | Target | postgres | dwh |
ms_mig_log | Migration tracking | mssql (or postgres) | migration_log |
The source and target database names are taken from these entries, so the commands do not pass --source_db_name or --target_db_name. The examples describe MigratorXpress v0.7.3.
Oracle to SQL Server
Two-phase approach: transfer data first, then add constraints.
Phase 1: Schema and data
Linux
./MigratorXpress --auth ./credentials.json \
--source_db_auth_id oracle_prod \
--source_schema_name FINANCE \
--target_db_auth_id mssql_target \
--target_schema_name finance \
--migration_db_auth_id ms_mig_log \
--n_jobs 4 \
--fasttransfer_p 2 \
--drop_tables_if_exists true \
--task_list translate create transfer diff
Windows (PowerShell)
.\MigratorXpress.exe --auth .\credentials.json `
--source_db_auth_id oracle_prod `
--source_schema_name FINANCE `
--target_db_auth_id mssql_target `
--target_schema_name finance `
--migration_db_auth_id ms_mig_log `
--n_jobs 4 `
--fasttransfer_p 2 `
--drop_tables_if_exists true `
--task_list translate create transfer diff
Phase 2: Constraints
Constraint copy (copy_pk, copy_ak, copy_fk) is available for Oracle, PostgreSQL and SQL Server sources with a SQL Server target. Foreign keys are created according to --fk_mode (default disabled).
Linux
./MigratorXpress --auth ./credentials.json \
--source_db_auth_id oracle_prod \
--source_schema_name FINANCE \
--target_db_auth_id mssql_target \
--target_schema_name finance \
--migration_db_auth_id ms_mig_log \
--task_list copy_pk copy_ak copy_fk
Windows (PowerShell)
.\MigratorXpress.exe --auth .\credentials.json `
--source_db_auth_id oracle_prod `
--source_schema_name FINANCE `
--target_db_auth_id mssql_target `
--target_schema_name finance `
--migration_db_auth_id ms_mig_log `
--task_list copy_pk copy_ak copy_fk
PostgreSQL to SQL Server
Linux
./MigratorXpress --auth ./credentials.json \
--source_db_auth_id postgres_prod \
--source_schema_name analytics \
--target_db_auth_id mssql_target \
--target_schema_name analytics \
--migration_db_auth_id ms_mig_log \
--n_jobs 4 \
--fasttransfer_p 2 \
--drop_tables_if_exists true \
--task_list translate create transfer diff
Windows (PowerShell)
.\MigratorXpress.exe --auth .\credentials.json `
--source_db_auth_id postgres_prod `
--source_schema_name analytics `
--target_db_auth_id mssql_target `
--target_schema_name analytics `
--migration_db_auth_id ms_mig_log `
--n_jobs 4 `
--fasttransfer_p 2 `
--drop_tables_if_exists true `
--task_list translate create transfer diff
SQL Server to PostgreSQL
Target schema, table and column names are created in lower case on PostgreSQL (dbo.Orders lands in sales.orders below). copy_fk is not available for a PostgreSQL target, so constraints are limited to copy_pk copy_ak.
Linux
./MigratorXpress --auth ./credentials.json \
--source_db_auth_id mssql_source \
--source_schema_name dbo \
--target_db_auth_id pg_target \
--target_schema_name sales \
--migration_db_auth_id ms_mig_log \
--n_jobs 4 \
--drop_tables_if_exists true \
--task_list translate create transfer diff copy_pk copy_ak
Windows (PowerShell)
.\MigratorXpress.exe --auth .\credentials.json `
--source_db_auth_id mssql_source `
--source_schema_name dbo `
--target_db_auth_id pg_target `
--target_schema_name sales `
--migration_db_auth_id ms_mig_log `
--n_jobs 4 `
--drop_tables_if_exists true `
--task_list translate create transfer diff copy_pk copy_ak
The same command works from an Oracle (oracle_prod) or PostgreSQL (postgres_prod) source. For an Oracle source, check the result of diff and spot-check date, timestamp and binary columns: the exactness of Oracle to PostgreSQL transfers was not verified.
Netezza to SQL Server
A Netezza source can only be migrated to SQL Server, and without constraint copy (copy_pk, copy_ak and copy_fk are rejected at startup with exit code 10).
Linux
./MigratorXpress --auth ./credentials.json \
--source_db_auth_id netezza_source \
--source_schema_name WAREHOUSE \
--target_db_auth_id mssql_target \
--target_schema_name warehouse \
--migration_db_auth_id ms_mig_log \
--n_jobs 4 \
--fasttransfer_p 2 \
--drop_tables_if_exists true \
--task_list translate create transfer diff
Windows (PowerShell)
.\MigratorXpress.exe --auth .\credentials.json `
--source_db_auth_id netezza_source `
--source_schema_name WAREHOUSE `
--target_db_auth_id mssql_target `
--target_schema_name warehouse `
--migration_db_auth_id ms_mig_log `
--n_jobs 4 `
--fasttransfer_p 2 `
--drop_tables_if_exists true `
--task_list translate create transfer diff
SQL Server to SQL Server
Clone or migrate schemas between SQL Server instances. SQL Server sources have no intra-table parallel method, so --fasttransfer_p has no effect; use --n_jobs for parallelism.
Linux
./MigratorXpress --auth ./credentials.json \
--source_db_auth_id mssql_source \
--source_schema_name dbo \
--target_db_auth_id mssql_target \
--target_schema_name dbo \
--migration_db_auth_id ms_mig_log \
--n_jobs 4 \
--drop_tables_if_exists true \
--task_list translate create transfer diff
Windows (PowerShell)
.\MigratorXpress.exe --auth .\credentials.json `
--source_db_auth_id mssql_source `
--source_schema_name dbo `
--target_db_auth_id mssql_target `
--target_schema_name dbo `
--migration_db_auth_id ms_mig_log `
--n_jobs 4 `
--drop_tables_if_exists true `
--task_list translate create transfer diff
Advanced scenarios
Incremental data sync
Re-run only the transfer and diff tasks to refresh data without recreating tables. Useful for periodic syncs during a phased migration.
./MigratorXpress --auth ./credentials.json \
--source_db_auth_id oracle_prod \
--source_schema_name SALES \
--target_db_auth_id mssql_target \
--target_schema_name sales \
--migration_db_auth_id ms_mig_log \
--n_jobs 4 \
--fasttransfer_p 2 \
--task_list transfer diff
transfer empties each target table before reloading it (default --load_mode truncate); use --load_mode append to add rows instead. --drop_tables_if_exists only affects the create task, so it is not needed here.
For Oracle and Netezza sources, a table whose maximum ROWID (Oracle) or creation transaction ID (Netezza) has not changed since the previous transfer is skipped (nothing to transfer). This only detects new rows: add --without_xid to force a full reload of every table.
Schema-only migration
Translate and create the schema without transferring any data. Useful for reviewing the translated column types (stored in the targetcolumns tracking table) before committing to a full migration.
./MigratorXpress --auth ./credentials.json \
--source_db_auth_id oracle_prod \
--source_schema_name INVENTORY \
--target_db_auth_id mssql_target \
--target_schema_name inventory \
--migration_db_auth_id ms_mig_log \
--drop_tables_if_exists true \
--task_list translate create
Parallel large tables
For schemas with very large tables, increase both parallelism levels:
./MigratorXpress --auth ./credentials.json \
--source_db_auth_id oracle_prod \
--source_schema_name EVENTS \
--target_db_auth_id mssql_target \
--target_schema_name events \
--migration_db_auth_id ms_mig_log \
--n_jobs 8 \
--fasttransfer_p 4 \
--drop_tables_if_exists true \
--task_list translate create transfer diff
--n_jobs 8migrates up to 8 tables concurrently.--fasttransfer_p 4splits each table whose estimated row count is at least--ft_large_table_th(default 250,000,000) into 4 parallel streams. Lower the threshold to parallelize smaller tables.
Higher parallelism increases load on both the source and target databases. Monitor CPU and I/O during large migrations and adjust values as needed.
Multi-schema patterns
Migrate multiple schemas in one run with SQL LIKE patterns or a comma-separated list. Omit --target_schema_name so that each source schema keeps its name on the target:
# All schemas starting with "APP_", each recreated under its own name
./MigratorXpress --auth ./credentials.json \
--source_db_auth_id oracle_prod \
--source_schema_name "APP_%" \
--target_db_auth_id mssql_target \
--migration_db_auth_id ms_mig_log \
--n_jobs 4 \
--drop_tables_if_exists true \
--task_list translate create transfer diff
# Every user schema in the database (--source_schema_name omitted)
./MigratorXpress --auth ./credentials.json \
--source_db_auth_id oracle_prod \
--target_db_auth_id mssql_target \
--migration_db_auth_id ms_mig_log \
--n_jobs 4 \
--drop_tables_if_exists true \
--task_list translate create transfer diff
To consolidate several source schemas into one target schema, give --target_schema_name a plain name. Tables with the same name in different source schemas would collide, so use this only when table names are unique:
# SALES_EU and SALES_US merged into the single target schema sales_all
./MigratorXpress --auth ./credentials.json \
--source_db_auth_id oracle_prod \
--source_schema_name "SALES_EU, SALES_US" \
--target_db_auth_id mssql_target \
--target_schema_name sales_all \
--migration_db_auth_id ms_mig_log \
--n_jobs 4 \
--drop_tables_if_exists true \
--task_list translate create transfer diff
Resume a run
If a run is interrupted or some tables failed (see the RUN SUMMARY at the end of the log), resume it with its run ID. Schema names and the task list come from the tracking database:
./MigratorXpress --auth ./credentials.json \
--source_db_auth_id oracle_prod \
--target_db_auth_id mssql_target \
--migration_db_auth_id ms_mig_log \
--n_jobs 4 \
--resume 20260203-cf5be0ac-159f-4dad-861e-8b2b6f3868d7
Best practices
-
Migrate data before constraints. Run
translate create transfer difffirst, thencopy_pk copy_ak copy_fkin a separate run. This avoids constraint-violation errors during bulk loading. -
Start with a small schema. Test the full workflow on a schema with a few tables before migrating a large production database.
-
Use
diffto validate. Always includediffin your task list to compare row counts, column counts and column statistics between source and target. -
Tune parallelism gradually. Begin with
--n_jobs 2 --fasttransfer_p 2and increase based on observed throughput and system load. -
Secure your credentials file. Passwords are stored in clear text in the credentials file: restrict its permissions to the migration user and keep it out of version control.
-
Review translated types. Run
translate createfirst and inspect the created tables (or thetargetcolumnstracking table) before transferring data. -
Check the exit code and the run summary. The process exits with code
40when some tables failed and41when all of them failed; read theRUN SUMMARY: n/m tables succeededblock and resume failed runs with--resume.
Next steps
- Quick Start Guide -- step-by-step setup
- CLI Reference -- all available options and flags
- Command Wizard -- build your command interactively