Migration Toolkit command options v55
To control details of the migration, append migration options when you run Migration Toolkit. For example, to migrate all schemas in a database, append the -allSchemas
option to the command:
./runMTK.sh -allSchemas
Note
- The
-allSchemas
parameter is supported only for the Oracle, EDB Postgres Advanced Server, and PostgreSQL source database. It isn't supported for Sybase, MS SQL Server, and MySQL source databases. - Migration Toolkit disables the user-created triggers while migrating the data. However, as PostgreSQL/EDB Postgres Advanced Server doesn't allow disabling inherited child partition triggers using the
DISABLE TRIGGER USER
clause inALTER TABLE
, the triggers activate during data migration on partition tables, which can cause unexpected results.
The command options that work with Migration Toolkit are grouped by their behavior, as shown in the table.
Feature | Relevant options |
---|---|
Offline migration options | -offlineMigration |
Import options | -sourcedbtype, -targetdbtype, -schemaOnly, -dataOnly |
Schema creation options | -dropSchema, -targetSchema |
Schema object selection options | -allTables, -tables, -excludeTables, -constraints, -ignoreCheckConstFilter, -skipCKConst, -skipFKConst, -skipColDefaultClause, -indexes, -triggers, -allViews, -views, -excludeViews, -allSequences, -sequences, -excludeSequences, -allProcs, -procs, -excludeProcs, -allFuncs, -funcs, -excludeFuncs, -checkFunctionBodies, -allPackages, -packages, -excludePackages, -allDomains, -allQueues, -queues, -excludeQueues -allRules, -allgroups, -groups |
Migration options | -truncLoad, -enableConstBeforeDataLoad, -retryCount, -safeMode, -fastCopy, -analyze, vacuumAnalyze, -replaceNullChar, -copyDelimiter, -batchSize, -cpBatchSize, -lobBatchSize, -fetchSize, -filterProp -customColTypeMapping, -customColTypeMappingFile |
Connection retry options | -connRetryCount, -connRetryInterval, -abortOnConnFailure |
Oracle-specific options | -allUsers, -users, -allProfiles, -profiles, -importPartitionAsTable, -objectTypes, -copyViaDBLinkOra, -allDBLinks -allSynonyms, -allPublicSynonyms, -excludeSynonyms, -allPrivateSynonyms, -useOraCase, -skipUserSchemaCreation |
Miscellaneous options | -help, -logDir, -logFileCount, -logFileSize, -logBadSQL -verbose, -version |
Migration options for parallel data loading | -loaderCount, -parallelLoadRowLimit, -tableLoaderLimit |
Specify options in file | -optionsFile |
Note
If you're using several options for a migration or have to specify a long list of objects for an option, consider using the -optionsFile
option to specify the values in a separate text file. See Specifying options using a file for more information.
Offline migration options
If you specify the -offlineMigration
option in the command line, Migration Toolkit performs an offline migration. During an offline migration, Migration Toolkit reads the definition of each selected object and creates an SQL script that, when executed later, replicates each object in Postgres.
Note
The following examples invoke Migration Toolkit in Linux. To invoke Migration Toolkit in Windows, use the runMTK.bat
command instead of the runMTK.sh
command.
To perform an offline migration of both schema and data, specify the ‑offlineMigration
keyword, followed by the schema scope:
Each database object definition is saved in a separate file with a name derived from each schema name and object type in your home folder. To specify an alternative file destination, include a directory name after the ‑offlineMigration
option:
To perform an offline migration of only schema objects (creating empty tables), specify the ‑schemaOnly
keyword in addition to the ‑offlineMigration
keyword when invoking Migration Toolkit:
To perform an offline migration of only data, omitting any schema object definitions, specify the ‑dataOnly
keyword and the ‑offlineMigration
keyword when invoking Migration Toolkit:
By default, data is written in COPY format. To write the data in a plain SQL format, include the ‑safeMode
keyword:
By default, when you perform an offline migration that contains table data, a separate file is created for each table. To create a single file that contains the data from multiple tables, specify the ‑singleDataFile
keyword:
Note
The -singleDataFile
option is available only when migrating data in a plain SQL format. You must include the -safeMode
keyword if you include the ‑singleDataFile
option.
Executing offline migration scripts
You can use the edb-psql or psql command line to execute the scripts generated during an offline migration. The following example describes restoring a schema (named hr) into a new database (named acctg) stored in EDB Postgres Advanced Server.
Use the
createdb
command to create the acctg database, into which you'll restore the migrated database objects: