Data Import

2025-06-09 09:10:28

Introduction to Data Import

Prerequisites
Supported Database Types

            Relational databases:

           MySQL: RDS for MySQL, public network/directly-connected MySQL, and MySQL from other sources.

           PostgreSQL: Analytical database PostgreSQL, public network/directly-connected PostgreSQL, and Postgresql from other sources.

Supported Data Formats

The locally uploaded SQL files, CSV files (comma-separated value), TXT files (comma-separated value), and JSON files are supported.

Supported Writing Modes
User-Friendly Interface

The user interface of the data import function is designed to be simple and intuitive, making it easy to use, even if you do not have technical expertise.

Application Scenarios

            Data migration: When changing systems or platforms, data import can help you migrate your old data to the new system.

            Data backup: You can export the source data and import it to the target database, serving as an emergency backup to prevent data loss.

Precautions

            Currently, the data import function only supports the change operation for a single instance, a single database/schema or a single table. That means, you cannot import multiple databases or multiple tables at the same time.

            Batch import of SQLs is now supported. The supported SQL types are DDL and DML. You can import table creation SQL and data change SQL for batch execution. Each SQL should be ended with a semicolon (;).

            To ensure optimal performance and speed during batch database imports, please utilize methods that enhance SQL performance, such as using the INSERT statement for SQL commands and INSERT INTO for data insertion.

Submitting Import Tasks

Prerequisites

            You have obtained permission to import the target database/schema.

            When the organization is in the Basic Version, the target instance must be logged in (If the instance is not logged in, the login window will appear when you select the target database/schema).

Precautions

            Currently, the import task only supports the data change operation for a single instance, a single database/schema or a single table. That means you cannot import multiple databases/schemata for multiple instances or import the same files by batch for a single table.

            The SQL will be executed in batches during import. By default, 1,000 rows are executed per batch and no transaction is guaranteed. After an order is imported, you can go to the instance metadata function to view the database/schema or query window to view the table data.

            If the selected import file type is SQL, the import target is database/schema. You cannot select Target List and Import Behavior. If the selected import file type is CSV or TXT, the import target is a single table.

            For MySQL and PostgreSQL data sources, when you select the import type as TXT or CSV, you can select Import Behavior as Create Table, which supports automatic table creation before import.

Procedure

1.      Log in to the DMS Console.

2.      On the left navigation bar, click Development Space > Data Import to go to the Data Import Management page.

3.      Click the Data Import button, and the order-filling pop-up window for Data Import appears. See Table 1 below for the content to be selected or entered in the order.

4.      After filling out the data import order, click the Submit button to finish submitting the order.

5.      When the organization is in the Basic Version, the data import order enters the task execution stage.

6.      When the organization is in the Enterprise Version, the data import order enters the pre-check, approval process, and task execution stages in sequence.

7.      You can view the order status of the data import task on the Import List page. If the import fails, you can click Details to view the reason. For more detailed operations, see Data Import->Data Import Order List.

Table 1 Description of Order Inputs

Input

Description

Database Type

Select the database type for import, such as MySQL or PostgreSQL.

Target Database

Select database/schema for data import, the data comes from the database instance added in the DMS Console. The database level can be selected for MySQL and SQLServer, and the schema level can be selected for PostgreSQL. Currently, you can only select a single target database/schema.

²  Note

If the instance corresponding to the target database/schema is not logged in, the login window for the instance appears when the target database/schema is selected.

Import File Type

Select the type of upload file for importing data:

            SQL: DDL and DML statements are supported. Each SQL should be ended with a semicolon (;). If you select this file type, you cannot specify the Target List and Writing Mode.

            CSV: The separator in the CSV file is a comma (;), and the first line of the file is the column name of the table.

            TXT: TXT file format is similar to CSV. The separator in the CSV file is a comma (;), and the first line of the file is the column name of the table.

Target List

File Encoding

Select the encoding type of the imported file:

            UTF-8: Checked by defaults. Applicable to most English text.

            GBK: Applicable to files with Chinese characters.

            Automatic Recognition: Select this option when you cannot determine the file encoding type.

Import Behavior

For MySQL and PostgreSQL data sources, after selecting the file type as CSV or TXT, you can select Create Table. For other data sources, Current Table is selected by default.

When you select Create Table, the system will guess the table creation structure you need according to the relevant fields in the imported file. You can click the table name of the new table to open the table structure editing page.

²  Note

Currently, for the table structure editing of the created table, the customized type of the database cannot be used as the table field type. The field type of the created table is closely related to the success of the import file. To select Create Table, please check the table structure carefully to see if it meets the requirements.

Writing Mode

For non-MongoDB and DDS data sources, select the writing mode for the import file:

            INSERT INTO: When data is inserted, the database checks the primary key and reports an error if duplication occurs.

            INSERT IGNORE INTO: When data is inserted, the database checks the primary key and ignores the current new data if the same record already exists in the table.

            REPLACE INTO: When data is inserted and replaced, the database checks the primary key. If the data in the database already exists, it will replace it with new data; if no data exists, the effect is the same as INSERT INTO.

²  Note

            To ensure the database performance when importing files, select the INSERT operation if possible.

            At present, the MySQL database supports three import methods: INSERT INTO, INSERT IGNORE INTO, and REPLACE INTO, and the PostgreSQL database supports the INSERT INTO import method.

Data Location

When selecting the file type as CSV and TXT, you can choose the first-row attribute of the file to be column name or data.

Attachment Upload

Click Upload File to upload the file corresponding to the selected file type.

²  Note

            At present, four file formats are supported, including SQL, CSV, TXT, and JSON. Before uploading, please check whether the file name suffix meets the requirements.

            Currently, only a single file can be uploaded.

            Make sure that the upload file size is no larger than 1 GB.

Order Description

Describes the order remarks. This content is displayed on the Order Details pop-up page.

Data Import Order List

Prerequisites

You have obtained permission to access the menu on the Data Import Management page.

Precautions

The Data Import Order List page displays only the orders that you have submitted.

Procedure

1.      Log in to the DMS.

2.      On the left navigation bar, click Development Space > Data Import to go to the Data Import Order List page.

3.     

Function Introduction to the Data Import Order List Page
Order Query

Enter the query condition and click the Query button for the query.

Supported Query Conditions:

            Order Status You can select the order status from the drop-down list.

            Time Frame: You can select the imported orders created or executed during a certain period.

            Keyword: You can enter the keyword related to the order number/database name/creator.

Data Import

Click the Data Import button to add a new data import task. For details, see Data Import->Submitting Import Tasks.

Retry

For abnormal orders, you can select whether to retry based on the reason for the abnormality. If required, click the Retry button to retry.

²  Note

Consider whether the retry is likely to succeed before clicking the button as this operation does not change the configuration.

Details

Locate the target order in the order list and click the order number or the Details button in the Operate column. On the opened Order Details page, you can view the details of the target order.

The Data Import Order Details page contains four sections: basic information, task status, pre-check, and approval process.

Basic Information

The table below describes the Basic Information section:

Content

Description

Order Type

Displays the import or export type of the order.

Creator

Displays the user that created the task.

Order Status

Displays the current order status.

Order Number

Displays the unique ID generated by the system for the order.

Create Time

Displays the time the order was saved to the system.

Last Operation Time

Displays the last time the order status was updated.

Database/Schema Information

Displays the target database/schema information corresponding to the import task.

Import File Type

Displays the import file type, which can be selected when creating an order task.

Writing Mode

Displays the writing mode of the task, which can be selected when creating an order task.

Order Description

Displays remarks, which can be filled in when creating an order task.

 

Task Status

Displays the status and execution time of the data import task. The status includes created, successful execution, execution in progress, and execution failure. When a task execution fails, you can click  on the failed task to see the reason for the failure.

Pre-check

Displays the pre-check details for the data import order, including connection check and permission check.

Approve

Displays the approval process details for the data import order. When the organization is in the Basic Version, after you submit a data export order, the data export task will be executed directly without going through the approval process. As such, no approval process information is required to be displayed. When the organization is in the Enterprise Version, after you submit the data export order, it needs to go through a preset approval process before executing the data export task. As such, the specific approval process information will be displayed.


eiEPPK7TjEYz