Invoking Migration Toolkit¶
After installing Migration Toolkit, and specifying connection properties for the source and target databases in the toolkit.properties file, Migration Toolkit is ready to perform migrations.
The Migration Toolkit executable is named runMTK.sh on Linux systems and
runMTK.bat on Windows systems. On a Linux system, the executable is
located in:
/usr/edb/migrationtoolkit/bin
On Windows, the executable is located in:
C:\Program Files\edb\mtk\bin
Note: If the following error appears upon invoking the Migration Toolkit, check the file permissions of the toolkit.properties file.
MTK-11015: The connection credentials file ../etc/toolkit.properties is
not secure and accessible to group/others users. This file contains
plain passwords and should be restricted to Migration Toolkit owner user
only.
The operating system user account running the Migration Toolkit must be the owner of the toolkit.properties file with a minimum of read permission on the file. In addition, there must be no permissions of any kind for group and other users. The following is an example of the recommended file permissions where user enterprisedb is running the Migration Toolkit.
-rw------- 1 enterprisedb enterprisedb 191 Aug 1 09:59 toolkit.properties
Importing Character Data with Embedded Binary Zeros (NULL characters)
Migration Toolkit properly supports importation of a column with a value of NULL.
However, Migration Toolkit does not support importation of NULL
character values (embedded binary zeros 0x00) with the JDBC connection
protocol. If you are importing data that includes the NULL character,
use the -replaceNullChar option to replace the NULL character with a
single, non-NULL, replacement character.
Note:
MTK implicitly replaces
NULLcharacters with an empty string.The
-replaceNullCharoption does not work with-copyViaDBLinkOraoption.
Once the data has been migrated, use a SQL statement to replace the
character specified by -replaceNullChar with binary zeros.
Migrating a Schema from Oracle¶
Unless specified in the command line, Migration Toolkit expects the source database to be Oracle and the target database to be Advanced Server. To migrate a complete schema on Linux, navigate to the executable and invoke the following command:
$ ./runMTK.sh <schema_name>
To migrate a complete schema on Windows, navigate to the executable and invoke the following command:
> .\runMTK.bat <schema_name>
Where:
schema_name
schema_nameis the name of the schema within the source database (specified in the toolkit.properties file) that you wish to migrate. You must include at least oneschema_name.
Note: When the default database user of a migrated schema is automatically migrated, the custom profile of the default database user is also migrated if such a custom profile exists. A custom profile is a user-created profile. For example, custom profiles exclude Oracle profiles DEFAULT and MONITORING_PROFILE.
You can migrate multiple schemas by following the command name with a comma-delimited list of schema names.
On Linux, execute the following command:
$ ./runMTK.sh <schema_name1>,<schema_name2>,<schema_name3>
On Windows, execute the following command:
> .\runMTK.bat <schema_name1>,<schema_name2>,<schema_name3>
Migrating from a Non-Oracle Source Database¶
If you do not specify a source database type and a target database type, Postgres assumes the source database to be Oracle, and the target database to be Advanced Server.
To invoke Migration Toolkit, open a command window, navigate to the executable, and invoke the following command:
$ ./runMTK.sh -sourcedbtype <db_type> -targetdbtype <target_type> [options, …] schema_name;
Where:
-sourcedbtype source_type
source_typespecifies the server type of the source database.source_typeis case-insensitive. By default,source_typeis oracle.source_typemay be one of the following values:
To migrate from: |
Specify: |
|---|---|
Oracle |
oracle (the default value) |
MySQL |
mysql |
SQL Server |
sqlserver |
Sybase |
sybase |
PostgreSQL |
postgres or postgresql |
Advanced Server |
enterprisedb |
-targetdbtype target_type
target_typespecifies the server type of the target database.target_typeis case-insensitive. By default,target_typeisenterprisedb.target_typemay be one of the following values:
To migrate to: |
Specify: |
|---|---|
Advanced Server |
enterprisedb |
PostgreSQL |
postgres or postgresql |
schema_name
schema_nameis the name of the schema within the source database (specified in thetoolkit.propertiesfile) that you wish to migrate. You must include at least oneschema_name.
The following example migrates a schema (table definitions and table
content) named HR from a MySQL database on a Linux system to an Advanced
Server host. Note that the command includes the ‑sourcedbtype and
-targetdbtype options:
$ ./runMTK.sh -sourcedbtype mysql -targetdbtype enterprisedb HR
On Windows, use the following command:
> .\runMTK.bat -sourcedbtype mysql -targetdbtype enterprisedb HR
You can migrate multiple schemas from a source database by including a comma-delimited list of schemas at the end of the Migration Toolkit command. The following example migrates multiple schemas (named HR and ACCTG) from a MySQL database to a PostgreSQL database:
On Linux, use the following command to migrate multiple schemas from a MySQL database:
$ ./runMTK.sh -sourcedbtype mysql -targetdbtype postgres HR,ACCTG
On Windows, use the following command form:
> .\runMTK.bat -sourcedbtype mysql -targetdbtype postgres HR,ACCTG