Updated on 2024-04-29 GMT+08:00

Migrating ClickHouse Data

This section describes the data migration capability.

Application Scenarios

Once you have performed a scale-out in ClickHouse, a data migration is necessary.

Precautions

  • Each data table is limited to a single task. A cluster can only execute one task at a time.
  • The local table's database must be either atomic (the default) or ordinary, and the table itself should be from the Mergetree family of engine tables, which includes both replicated and non-replicated types. Materialized view charts are not compatible.
  • The backup relationship for local tables mirrors that of clusters. In the context of shards, distributed tables are utilized.
  • By default, the original table becomes read-only during data migration.
  • Initially, data is moved to a temporary table. Subsequently, the original table is swapped with the table containing the migrated data. This transition, which may result in reading incorrect data, is completed within seconds.
  • Should cluster issues arise, the data migration process can be paused. After addressing the reported error in the cluster, the migration task can resume.
  • The source and redistribution nodes involved in data migration must share identical tables.
  • Data migration is not supported on a single node system.

Creating a Data Migration Task

  1. Log in to the CloudTable console.
  2. Click in the upper left corner to select a region.
  3. Click Cluster Management and click a cluster name to go to the cluster details page.
  4. In the navigation pane, choose Data Migration.

    Table 1 Data migration parameters

    Parameter

    Description

    Task ID/Name

    ID or name of the new migration task.

    Logical Cluster

    Name of the selected logical cluster.

    Source Nodes

    Node where data is stored.

    Distribution Nodes

    Node where data is distributed.

    Status/Progress

    Status/Progress of data distribution.

    The task can be in the initializing, running, or completed state.

    Created

    Task creation time.

    Start Time

    Task start time.

    Update Time

    Task modification time.

    Operation

    • Start: Start the task.
    • Edit: Edit task information.
    • Cancel: Cancel the task.
    • Details: View task details.
    • Delete: Delete the task.

  5. Click New Task in the upper left corner.

    1. Enter a task name (starting with a letter).
    2. Select a logical cluster.
    3. Select the migration percentage.
    4. Select the source node.
    5. Select a redistribution node.
    6. Select the data table to be migrated.

  6. Click OK to create the task.
  7. Click Start in the Operation column to start the created task.

Modifying a Data Migration Task

  1. Log in to the CloudTable console.
  2. Click in the upper left corner to select a region.
  3. Click Cluster Management and click a cluster name to go to the cluster details page.
  4. Choose Data Migration.
  5. Click Edit in the Operation column.
  6. After modifying the parameters, click OK.

Viewing Migration Task Details

  1. Log in to the CloudTable console.
  2. Click in the upper left corner to select a region.
  3. Click Cluster Management and click a cluster name to go to the cluster details page.
  4. Choose Data Migration.
  5. Click Details in the Operation column to access the task details page.
  6. View task information.

Deleting a Migration Task

  1. Log in to the CloudTable console.
  2. Click in the upper left corner to select a region.
  3. Click Cluster Management and click a cluster name to go to the cluster details page.
  4. Choose Data Migration.
  5. Click Delete in the Operation column. In the displayed dialog box, click OK to delete the task.