Migration Errors

During the migration process, the migration summary displays the progress of the migration. If an error occurs, the summary will display information about the error. The migration summary is also written to a log file. The default locations for the log files are:

On Linux:

$HOME/.enterprisedb/migration-toolkit/logs

On Windows, the log files are saved to:

%HOMEDRIVE%%HOMEPATH%\.enterprisedb\migration-toolkit\logs

You can specify an alternate log file directory with the -logdir <log_path> option in Migration Toolkit.

Connection Errors

Migration Toolkit uses information from the toolkit.properties file to connect to the source and target databases. Most of the connection errors that occur when using Migration Toolkit are related to the information specified in the toolkit.properties file. Use the following section to identify common connection errors, and learn how to resolve them.

Invalid username/password

When I try to perform a migration from an Oracle database with Migration Toolkit, I get the following error:

MTK-11009: Error Connecting Database "Oracle"
DB-1017: java.sql.SQLException: ORA-01017: invalid username/password;
logon denied
The user name or password specified in the toolkit.properties file is
not valid to use to connect to the Oracle source database.

To resolve this error, edit the toolkit.properties file, specifying the name and password of a valid user with sufficient privileges to perform the migration in the SRC_DB_USER and SRC_DB_PASSWORD properties.

Connection rejected: FATAL: password

When I try to perform a migration with Migration Toolkit, I get the following error:

MTK-11009: Error Connecting Database "Advanced Server"
DB-28P01: com.edb.util.PSQLException: FATAL: password authentication
failed for user "name"

The user name or password specified in the toolkit.properties file is not valid to use to connect to the Postgres database.

To resolve this error, edit the toolkit.properties file, specifying the name and password of a valid user with sufficient privileges to perform the migration in the TARGET_DB_USER and TARGET_DB_PASSWORD properties.

Exception: ORA-28000: the account is locked

When I try to perform a migration from an Oracle database with Migration Toolkit, I get the following error message:

MTK-11009: Error Connecting Database "Oracle"
DB-28000: java.sql.SQLException: ORA-28000: the account is locked
The Oracle account associated with the user name specified in the
toolkit.properties file is locked.

To resolve this error, you can either unlock the user account on the Oracle server or edit the toolkit.properties file, specifying the name and password of a valid user with sufficient privileges to perform the migration in the SRC_DB_USER and SRC_DB_PASSWORD parameters.

Exception: oracle.jdbc.driver.OracleDriver

When I try to perform a migration with Migration Toolkit, the migration fails and I get the error message:

MTK-11009: Error Connecting Database "Oracle"
java.lang.ClassNotFoundException: oracle.jdbc.driver.OracleDriver

Before using Migration Toolkit, you must download and install the appropriate JDBC driver for the database that you are migrating from. See Installing Source-Specific Drivers for complete instructions.

I/O exception: The Network Adapter could not establish the connection

When I try to perform a migration with Migration Toolkit, I get the following error:

MTK-11009: Error Connecting Database "Oracle"
DB-17002: java.sql.SQLException: Io exception: The Network Adapter could
not establish the connection

The JDBC URL for the source database specified in the toolkit.properties file contains invalid connection properties.

To resolve this error, edit the toolkit.properties file specifying valid connection information for the source database in the SRC_DB_URL property. Please note that the SRC_DB_URL value is database-specific; consult the table of contents for detailed information for your source database type.

Exception: The URL specified for the “target” database is invalid

When I try to perform a migration with Migration Toolkit, I get the following error:

MTK-10045: The URL specified for the "target" database is invalid.
Check the connectivity credentials.

The JDBC URL for the target database (Advanced Server) specified in the toolkit.properties file contains invalid connection properties.

To resolve this error, edit the toolkit.properties file, specifying valid connection information for the target database in the TARGET_DB_URL property. For information about forming a JDBC URL for Advanced Server, see Defining an Advanced Server URL.

Migration Errors

The following errors may occur after Migration Toolkit has successfully connected to the target and source database servers.

ERROR: Extra Data after last expected column

When migrating a table online, I get the error message:

MTK-17001: Error Loading Data into Table: table_name
DB-22P04: com.edb.util.PSQLException: ERROR: extra data after last
expected column
Where: COPY table_name, line 5: "50|HR|LOS|ANGELES"

This error occurs when the data in a column in table_name includes the delimiter character. To correct this error, change the delimiter character to a character not found in the table contents.

Note

In this example, the pipe character (|) occurs in the text,``LOS|ANGELES``, intended for insertion into the last column, and the Migration Toolkit is run using the -copyDelimiter '|' option, which results in the error.

Error Loading Data into Table: TABLE_NAME

When performing a data-only migration, I get the following error:

MTK-17001: Error Loading Data into Table: TABLE_NAME
DB-42P01: com.edb.util.PSQLException: ERROR: relation
"schema.\ table_name" does not exist
*I also get the error:*
Trying to reload table: TABLE_NAME through bulk inserts with a batch
size of 100
MTK-17001: Error Loading Data into Table: TABLE_NAME
DB-42P01: com.edb.util.PSQLException: ERROR: relation
"schema.\ table_name" does not exist

You must create a table to receive the data in the target database before you can migrate the data. Verify that a table (with a name of TABLE_NAME ) exists in the target database; create the table if necessary and re-try the data migration.

Error Creating Constraint CONS_NAME_FK

When I perform a table migration that includes indexes and constraints, I get the following error message:

MTK-15001: Error Creating Constraint EMP_DEPT_FK
DB-42P01: com.edb.util.PSQLException: ERROR: relation "hr.departments"
does not exist
Creating Constraint: EMP_JOB_FK
MTK-15001: Error Creating Constraint EMP_JOB_FK
DB-42P01: com.edb.util.PSQLException: ERROR: relation "hr.jobs" does not exist
Creating Constraint: EMP_MANAGER_FK
Schema HR imported with errors.
One or more schema objects could not be imported during the migration
process. Please review the migration output for more details.
Migration logs have been saved to
/home/user/.enterprisedb/migration-toolkit/logs
******************** Migration Summary ********************
Tables: 1 out of 1
Constraints: 4 out of 6
Total objects: 7
Successful count: 5
Failed count: 2
Invalid count: 0
List of failed objects
======================
Constraints
--------------------
1. HR.EMPLOYEES.EMP_DEPT_FK
2. HR.EMPLOYEES.EMP_JOB_FK

The table you are migrating includes a foreign key constraint on a table that does not exist in the target database. Migration Toolkit creates the table, omitting the foreign key constraint.

You can avoid generating the error message by including the -skipFKConst option in the Migration Toolkit command.

Error Loading Data into Table

I’ve already migrated the table definition; when I try to migrate the data into the table, I get an error:

MTK-17001: Error Loading Data into Table: DEPARTMENTS
DB-22P04: com.edb.util.PSQLException: ERROR: extra data after last
expected column
Where: COPY departments, line 1: "10 Administration 200 1700"
Trying to reload table: DEPARTMENTS through bulk inserts with a batch
size of 100
MTK-17000: Batch entry 0 INSERT INTO hr.DEPARTMENTS VALUES (10,
'Administration', 200, 1700); was aborted. Call getNextException to see
the cause.
DB-42601: java.sql.BatchUpdateException: Batch entry 0 INSERT INTO
hr.DEPARTMENTS VALUES (10, 'Administration', 200, 1700); was aborted.
Call getNextException to see the cause., Skipping Batch
MTK-17000:ERROR: INSERT has more expressions than target columns
Position: 48
[DEPARTMENTS] Table Data Load Summary: Total Time(s): 0.037 Total Rows:0
Data Load Summary: Total Time (sec): 0.168 Total Rows: 0 Total Size(MB):0.0
Schema HR imported with errors.

The table definition (in the target database) does not match the migrated data. If you’ve altered the target or source table, confirm that the table definition and the data are compatible.

ERROR: value too long for type

I’ve already migrated the table definition; when I try to migrate the data into the table, I get the following error:

MTK-17001: Error Loading Data into Table: DEPARTMENTS
DB-22001: com.edb.util.PSQLException: ERROR: value too long for type
character(1)
Where: COPY departments, line 1, column location_id: "1700"
Trying to reload table: DEPARTMENTS through bulk inserts with a batch
size of 100
MTK-17000: Batch entry 0 INSERT INTO hr.DEPARTMENTS VALUES (10,
'Administration', 200, 1700); was aborted. Call getNextException to see
the cause.
DB-22001: java.sql.BatchUpdateException: Batch entry 0 INSERT INTO
hr.DEPARTMENTS VALUES (10, 'Administration', 200, 1700); was aborted.
Call getNextException to see the cause., Skipping Batch
MTK-17000:ERROR: value too long for type character(1)

A column in the target database is not large enough to receive the migrated data; this problem could occur if the table definition is altered after migration. The column name (in our example, location_id) is identified in the line that begins with Where:.

Where: COPY departments, line 1, column location_id: "1700"

To correct the problem, adjust the column size and re-try the migration.

ERROR: Exception in thread:OutOfMemoryError

When migrating from a MySQL database, I encounter the following error:

Loading Table: big_range ...
Exception in thread "dataload_job_1" java.lang.OutOfMemoryError: Java
heap space
at com.mysql.jdbc.MysqlIO.nextRow(MysqlIO.java:1370)
at com.mysql.jdbc.MysqlIO.readSingleRowSet(MysqlIO.java:2369)
at com.mysql.jdbc.MysqlIO.getResultSet(MysqlIO.java:451)
at com.mysql.jdbc.MysqlIO.readResultsForQueryOrUpdate(MysqlIO.java:2076)
at com.mysql.jdbc.MysqlIO.readAllResults(MysqlIO.java:1451)
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1787)
at com.mysql.jdbc.Connection.execSQL(Connection.java:3277)
at com.mysql.jdbc.Connection.execSQL(Connection.java:3206)
at com.mysql.jdbc.Statement.executeQuery(Statement.java:1232)
at com.edb.dbhandler.mysql.Data.getTableData(Data.java:90)
at com.edb.DataLoader.loadDataInFastMode(DataLoader.java:594)
at com.edb.DataLoader.run(DataLoader.java:186)
at java.lang.Thread.run(Thread.java:722)

By default, the MySQL JDBC driver will fetch all of the rows that reside in a table into the client application (Migration Toolkit) in a single network round-trip. This behavior can easily exceed available memory for large tables.

To correct the problem, specify -fetchSize 1 as a command line argument when you retry the migration.