Open Source RDBMS - Seamless, Scalable, Stable and Free

한국어 | Login |Register

CUBRID Migration Toolkit Getting Started


3 Getting Started

3.1 Download CMT

Please visit the web site http://www.cubrid.org/?mid=downloads&item=cubrid_migration_toolkit to download the recent version of CMT.

Please make sure the file you downloaded is fit with your OS.

CMT installation File

OS

GUI or Console

CUBRID-Migration-Toolkit-{version}-windows-i386.zip

Windows 32

GUI

CUBRID-Migration-Toolkit-{version}-windows-x64.zip

Windows 64

GUI

CUBRID-Migration-Toolkit-console-{version}-windows.zip

Windows 32/64

Console

CUBRID-Migration-Toolkit-console-{version}-linux.tar.gz

Linux 32/64

Console

CUBRID-Migration-Toolkit-{version}-linux-i386.tar.gz

Linux 32

GUI

CUBRID-Migration-Toolkit-{version}-linux-x86_64.tar.gz

Linux 64

GUI

CUBRID-Migration-Toolkit-{version}-macosx-carbon.tar.gz

Max OS

GUI

 

3.2 Install CMT

CMT is green software, so all the users can do is uncompress the compressed download file to a specified directory.

3.3 Start CMT GUI

Go into the directory where you uncompressed the CMT files and execute the executable file which named “cubridmigration”, the executable file is “cubridmigration.exe” in windows OS.

3.4 Start migration work

3.4.1 Migration from an online DB to an online CUBRID DB

Step 1: Click “New Migration” button and check one of the radio buttons “Online CUBRID database” “Online MySQL database” “Online Oracle database” in the source type area. Check the radio button “Online CUBRID database” in the destination type area and click “Next”.

Step 2: Select a DB connection in the table list and press "next" button. If The DB connection is not in the table view, press "New" to add the JDBC connection information to table view.

Step 3: Select a CUBRID connection in the table list. If the CUBRID connection is not in the table view, press "New" to add CUBRID JDBC connection information to table view. If target CUBRID DB is running in HA mode, please make sure the "Create PK before migrating data" button is checked. If "Write the records which can’t be insert into target database into SQL files" buttons is checked, the CMT will write the error records into some SQL files which are saved into “errorsqls” directory in the CMT’s root directory.

Step 4: There a two part in this view, the left part is a tree listing all DB objects in the source DB, the right part will display the detail of selected source DB object and related target DB object information. Users can decide which table will be exported from source and import into target DB. And users can change the definitions of target DB objects. Users also can add SQL statements as virtual tables to import into target database.

Step 5: Confirm the settings. If users don’t want to start migration, just want to create a migration script, the button "New script" will create a new script and list it in the script explorer. "Export Script" can save the migration script as an external file.

After all settings are confirmed, press the "Start" button to start the migration process.

3.4.2 Migration from an online DB to local files

Step 1: Click “New Migration” button and check one of the radio buttons “Online CUBRID database” “Online MySQL database” “Online Oracle database” in the source type area. Check one of the radio buttons “Local CUBRID dump files” “Local SQL script files” “Local CSV files” “Local XLS files” in the destination type area and click “Next”.

Step 2: Select a DB connection in the table list and press "next" button. If The DB connection is not in the table view, press "New" to add the JDBC connection information to table view.

Step 3: Input a directory where the files will be saved into. Users can specify a prefix of the output files. "One table one file" option will be shown if destination type is “Local CUBRID dump files” or “Local SQL files”. If "One table one file" button is checked, the CMT will write the differenct table records into different data files.

Step 4: There a two part in this view, the left part is a tree listing all DB objects in the source DB, the right part will display the detail of selected source DB object and related target DB object information. Users can decide which table will be exported from source and import into target DB. And users can change the definitions of target DB objects. Users also can add SQL statements as virtual tables to import into target directory.

Step 5: Confirm the settings. If users don’t want to start migration, just want to create a migration script, the button "New script" will create a new script and list it in the script explorer. "Export Script" can save the migration script as an external file.

After all settings are confirmed, press the "Start" button to start the migration process.

Note: If exporting data to XLS files, some column’s values which type is BLOB/Binary or too big Varchar/Char may be lost.

3.4.3 Migration from MySQL XML Dump File

Step 1: Click “New Migration” button and check the radio button “Local MySQL XML dump file” in the source type area. Check one of the radio buttons  in the destination type area and click “Next”.

Step 2: Select a MySQL XML dump file in your computer wand waiting for the CMT checking the validation of selected file. If the file is a valid MySQL XML dump file, press "next" button. If users want re-check the XML file, press "Analyze" button.

Step 3: Select destination, it can be an online CUBRID DB or local files depending on the selection in the first step.

Step 4: There a two part in this view, the left part is a tree listing all DB objects in the source DB, the right part will display the detail of selected source DB object and related target DB object information. Users can decide which table will be exported from source and import into target DB. And users can change the definitions of target DB objects. At this step, users can’t input SQLs if source is MySQL XML dump file.

Step 5: Confirm the settings. If users don’t want to start migration, just want to create a migration script, the button "New script" will create a new script and list it in the script explorer. "Export Script" can save the migration script as an external file.

After all settings are confirmed, press the "Start" button to start the migration process.

 

3.4.4 Start SQL importing

Start SQL importing wizard

When CMT GUI is started, click the “New Migration”. Select the source type “Local SQL script files” and the destination type “Online CUBRID database” and click “next” button.

Select SQL Files

Add the SQL files into table view and press “Top”, “Up”, “Down”, “Bottom” to change the execution order of the files.

Press “Remove” button to remove the SQL files from table view.

Select target CUBRID DB

Select an online CUBRID DB in the table list or press “New” to create a new CUBRID JDBC connection.

Review configurations

Review all configurations and press "Start" to start importing.

3.4.5 Start CSV importing

Start CSV importing wizard

When CMT GUI is started, click the “New Migration”. Select the source type “Local CSV files” and the destination type “Online CUBRID database” and click “next” button.

Select target CUBRID DB

Select an online CUBRID DB in the table list or press “New” to create a new CUBRID JDBC connection.

Select CSV Files

Add the CSV files into table view and set the column mappings of every CSV file.

Press “Remove” button to remove the CSV files from table view.

Users can preview the top 10 rows of the selected CSV file by the right part.

Review configurations

Review all configurations and press "Start" to start importing.

3.5 View report

After migration finished, press "View report" button in the migration monitor UI, the migration report will be opened.

The report lists every DB objects’ exporting/importing status.

Users can save the tables information into a excel file and the text information (Nonsupport objects and Logs) will be save into a text file.

 

3.6 View migration history

When CMT GUI is started, click the "History" on the toolbar or "Migration" >> "History" in the main menu, a view will be opened, it is the view of migration history management.

The migration history manager:

Double click the item in the opened view. A migration’s report will be opened:

Select a migration history and click the button " ", a new migration wizard will be opened with the migration history’s migration settings.

If there are errors in the migration report, a dialog will be popped as follows:


The first option means reserving all the history’s migration settings when opening migration wizard.

The second option means only selecting the tables’ schema and data which was not migrated successfully.

The third option means only selecting the tables’ data which was not migrated successfully.

The last option: Re-migrate the SQL files filled with the error records’ insert statements:

 

This feature is available only the migration target is an online database.

 

And the option “Write the records which can’t be inserted into target database to files” should be checked in the selection target database page.

With upper options, the records which can’t be inserted into the target database will be written into some SQL files as insert statements.

 

When the migration finished, Clicking “Restart migration” in the migration history management view, if the history recorded some errors, a new dialog will be popped and a new option will be displayed as follows:


Check this option and click the “OK”, a SQL importing wizard will be opened:


3.7 Database conection management

Users can manage database connections in the migraiont wizard.


Users can name a JDBC connection. The JDBC’s connection name cant be duplicated.

MySQL, Oracle or CUBRID database system are supported.

And Users can use “JDBC Advanced…” to define the JDBC connection URL.

 

3.8 Migration Reservation

Select a migration script in the migration script explorer, and click the button "Reservation" on the toolbar or "Migration" >> "Reservation" in the main menu,

And a dialog will be popped. Users can set when will start a migration with the selected migration script.


3-9-2.png

There are 3 modes to set the reservation:

One time only: the migration script will run only once at the setting date time.

Repeat Every Day: the migration script will run every day at the setting time.

Advance: CMT support unix cron pattern to launch the migration script.

3.9 Preference

Users can change the data type mapping, some performace parameters, and some data transformation settings in preference dialog.

The prefercen dialog can be opened by clicking the "Preference" on the toolbar or "Migration" >> "Preference" in the main menu.

Genneral

3-10-4.png

 

Show window maximize: If this option is checked, the CMT window will be maximized when it is started.

Always exit without prompt: If this option is checked, there is no confirm dialog popped before CMT window is closed.

Check the new information of CUBID: If this option is checked, a web page below will be opened when CMT is started.

 

3-10-5.png

Migration

3-10-6.png

 

Default Thread Count: It influents the performace of migration, min value is 1 and max value is 50.

Default Page Fetching Count: If source database is a CUBRID database, CMT will fetch the records by page. This option tells CMT how many records should be fetched each time.

Default Commit Count: Tell CMT the max size of records in a transaction.

Temporary File Path: CMT will save all temporary files at the specific path.

 


MySQL to CUBRID data type mapping


3-10-1.png

Oracle to CUBRID data type mapping


3-10-2.png

CUBRID to CUBRID data type mapping


3-10-3.png

 

3.10 Start CMT Console

Run the executable script file which name is “migration.bat” in windows and “migration.sh” in linux.

One parameter is required, and that is the full name of a local migration script.

And there are four optional parameters.

For more information, please run migration.sh/migration.bat without any parameters, some help text will be printed onto the screen to let users know how to use this tool.

And a java environment is required.
comments powered by Disqus
Page info
viewed 1822 times
translations en
Author
posted last year by
kevinlin79
Contributors
updated last year by
View revisions
Share this article