DBeaver supports data migration from tables of one database to tables of another one.

To perform data transfer, please, follow the steps below.

Step 1: Define the data source

In the Database Navigator select one or more tables you want to export. In the context menu choose "Export Data".(Note: you also can export data from the custom SQL queries results. For that in the results context menu choose "Export results").
Data migration - 图1

Step 2: Define data transfer target type

In the opened dialog box choose Database type as the data transfer target and press Next.
Data migration - 图2

Step 3: Define data mapping

For proper table mapping the following options are available:
Data migration - 图3

  • Target container - defines a database or a scheme where the data will be transferred to. Press Data migration - 图4 button and choose the container.
    <img src="images/dt/dbt_step3_Browse_4_target_container.png" width="600""/>

  • Source - contains names of all the tables selected at step 1. You can also see the list of columns existing in the source table by pressing Data migration - 图5.Data migration - 图6

  • Target - contains names of the tables where the data will be transferred to.

  • Mapping - contains the list of actions to be applied to the source data on data transfer. The following options are available:

Create- the source data will be populated into a newly created table or column of the target container.Skip - the source data will not be transferred to the target container.Existing - the source data will be transferred to the table that already exists in the target container.Unassigned - this value is set by default when there is no target defined.

If cells are marked as Data migration - 图7 it means that in the target table there are no source tables with matching names, otherwise the names will be filled in automatically.

You can define a target table by clicking on a cell in the Target column and entering its name, or press the New button Data migration - 图8 and enter a new name in the opened dialog box.
Data migration - 图9
You can also choose a name for a target table from the drop-down list.
Data migration - 图10
Or select from the list of tables already existing in the target container by pressing the Browse button Data migration - 图11.
Data migration - 图12
To define mapping setting for a column in a target table, release the list of source table columns by pressing Data migration - 图13 next to the table's name in the Source column, then click the name of the target column and enter a new one or select one from the dropdown list. To collaps the list, press Data migration - 图14.

If you want tables of the target container to be named like those of source, press the Auto assign button Data migration - 图15 and the Target column will be automatically populated.

You can also define the names of target columns, as well as their data types, by clicking a row with a table name and pressing the Columns button Data migration - 图16.
Data migration - 图17
The following elements are available here:

  • Source column -this column contains names of columns existing in the selected source table;

  • Source type - this column contains the list of data types assigned to the columns in the selected source table;

  • Target column - this column contains names of target table columns where the data from source column will be transferred to. To change the name, click the cell and enter a new name.

  • Target type - this column contains the list of data types that will be assigned to the columns in the target table.

IMPORTANT: Sometimes data types that are supported on the source database are not supported on the target or vice versa.To set a data type for a column in a target table, click the cell in the Target Type column and select one from the dropdown list of data types supported on the target.

  • Mapping - this column contains the list of actions to be applied to the data on data transfer.

To change mapping type click a cell in Mapping column of Table mapping dialog box and select the required mapping type.
Data migration - 图18
You can also view the SQL script that will be run on data transfer by pressing the DDL button Data migration - 图19.
Data migration - 图20
The following keyboard shortcuts for easy navigation within the mapping table area of Table mapping screen are supported:

ShortcutAction
UpMoves one row up.
DownMoves one row down.
RightReleases the list of source table columns.
LeftSwaps the list of source table columns.
SpaceAuto-assigns the target.
DelSets mapping type to skip.

Configure data mapping and press Next.

Step 4: Define export settings

Data export settings are grouped into Extraction settings and Data load settings.
Data migration - 图21

Extraction Settings

Extraction settings define how the data will be pulled from the source. The following options are available:

OptionDescription
Maximum threadsDefines a number of threads to be used for data transfer.
Extract typeSelect Single query option if your data load is not too big. Select By segments option if you need to migrate a solid amount of data. When this options is selected you can set the Segment size value, that is to define a number of rows to be transferred in each segment.
Open new connectionsIf selected, a new connection will be opened and data transfer will not interfere with other calls to the database whose data is being transferred.
Select row countIf selected, a progress bar displaying data migration process will be shown.

Data load settings

Data load settings define how the extracted data will be pushed to the target. The following options are available.

OptionDescription
Truncate data load table before loadSelect this check-box only if you want all the data be cleared from the target table. Be very careful with this option!
Open new connectionsUse this option to speed up data transfer. If selected, a new connection will be opened and data transfer will not interfere with other calls to the database where data is being transferred to.
Use transactionsThis option allows to speed up data transfer and to define the number of rows for each transaction by setting Commit after insert of parameter.
Open table editor on finishIf selected, the table editor to be opened when data tanfer is over.
Show finish messageIf selected, a notification message will be shown when transfer is over.

Step 5: Confirm

Data migration - 图22
Check out data transfer settings and press Finish.