Skip to main content

Import Replication Object Templates

When you create a replication task, you can use an Excel configuration template to import multiple replication objects in bulk. The template imports replication objects by their exact source table names.

Before you begin​

  • Add the source and target data sources to NineData. For details, see Add Data Source.
  • Confirm that the selected replication link supports custom replication objects and configuration import.
  • Prepare the source database name, source table name, target database name, and target table name. Make sure your account can read source-object metadata.

Procedure​

  1. In the navigation menu, click Replication > Data Replication.

  2. On the Replication page, click Create Replication.

  3. On the Source & Target tab, configure the task name, source data source, target data source, and replication type, and then click Next.

  4. On the Objects tab, select Customized Object, and then click Import Config.

  5. In the import dialog:

    1. Click Download Template to download the Excel template.
    2. Fill in the template without deleting or renaming its columns. Each row represents one object to import.
    3. Click Upload and select the edited Excel file.
    4. Click Import Config to import the configuration.

Parameters​

ParameterDescriptionExample
source_table_nameThe exact source table name to import.example_tbl_name
target_table_nameThe target table name.example_tbl_name
source_database_nameThe source database name.test_db
target_database_nameThe target database name.test_db_bak
column_listThe list of columns to synchronize.["col1", "clo2", "col3"]
extra_configurationA JSON string containing additional configuration. Use column_rules for column mappings and value rules, and filter_condition for row-level filtering.{"extra_config": {"column_rules": [...]}}
tip

The following JSON represents the two complete example rows in the downloaded Excel template. When uploading the file, keep the Excel column names and enter the extra_configuration value as a JSON string. This code block is not a JSON file that you can upload directly.

[
{
"source_table_name": "example_tbl_name",
"target_table_name": "example_tbl_name",
"source_database_name": "test_db",
"target_database_name": "test_db_bak",
"column_list": ["col1", "clo2", "col3"],
"extra_configuration": {
"extra_config": {
"column_rules": [
{
"column_name": "example_column_name",
"target_column_name": "example_target_column_name",
"target_column_type": "int",
"column_value": "current_timestamp()"
},
{
"column_name": "example_column_name",
"target_column_name": "example_target_column_name",
"target_column_type": "int"
}
],
"filter_condition": "example_condition_expression"
}
}
},
{
"source_table_name": "example_order_tbl",
"target_table_name": "example_order_tbl",
"source_database_name": "test_db",
"target_database_name": "test_db_bak",
"column_list": ["col1", "clo2", "col3"],
"extra_configuration": {
"extra_config": {
"column_rules": [
{
"column_name": "example_column_name",
"target_column_name": "example_target_column_name",
"target_column_type": "int",
"column_value": "current_timestamp()"
},
{
"column_name": "example_column_name",
"target_column_name": "example_target_column_name",
"target_column_type": "int"
}
],
"filter_condition": "example_condition_expression"
}
}
}
]

The following fields can be used in extra_configuration:

  • column_name: The source column name.
  • target_column_name: The target column name.
  • target_column_type: The target column type.
  • column_value: The column value, which can be an SQL function or a constant value.
  • filter_condition: A row-level data filtering condition.

For example, enter the following JSON string in an extra_configuration cell:

{
"extra_config": {
"column_rules": [
{
"column_name": "example_column_name",
"target_column_name": "example_target_column_name",
"target_column_type": "int",
"column_value": "current_timestamp()"
}
],
"filter_condition": "example_condition_expression"
}
}

Result​

After the import, return to the object selection page and review the source and target object lists. If a source table does not exist, NineData displays the validation result with the source table name, target table name, source database name, and target database name. Update the Excel file and import it again, or click Cancel Import to cancel the import. When the configuration is correct, click Continue Import to continue.