Preparations
Migrate from Shared-nothingOn source cluster
You do not need to perform any preparations on the source cluster.On target cluster
The following preparations must be performed on the target cluster for data migration.Open ports
If you have enabled the firewall, you must open these ports:
Migrate between Shared-data
On source cluster
During migration, the source cluster’s Auto-Vacuum mechanism may delete historical data versions that the target CNs still need to read. To prevent this situation, you must extend the Auto-Vacuum grace period by dynamically setting the FE configuration itemlake_autovacuum_grace_period_minutes to a significantly large value:
30 after migration.
On target cluster
The following preparations must be performed on the target cluster for data migration.Open ports
If you have enabled the firewall, you must open these ports:Disable Compaction
You must disable Compaction on the target cluster during migration to prevent conflicts with incoming replication data.-
Dynamically disable Compaction:
-
To prevent Compaction from being re-enabled after a cluster restart, also add the following configuration to the FE configuration file fe.conf:
Create source storage volumes on the target cluster
The Migration Tool identifies which storage volume each source table uses, and looks up a corresponding storage volume on the target cluster using the naming conventionsrc_<source_volume_name>. You must pre-create these storage volumes before starting migration.
Important
These storage volumes are used only during migration to give target CNs read access to the source cluster’s object storage. After migration is complete, they are no longer needed and can be dropped.
-
On the source cluster, list all storage volumes:
-
For each storage volume used by the tables you plan to migrate, describe it to get its configuration:
Example output:
-
On the target cluster, create a mirrored storage volume using the same object storage credentials, but with the name prefixed by
src_:Note- Set
aws.s3.enable_partitioned_prefixtofalseregardless of the source cluster’s setting. The migration tool reads files using the source partition’s full path directly, so partitioned prefix must not be applied to the mirrored volume. - Repeat this step for each unique storage volume used by the tables to be migrated. For example, if the source uses
builtin_storage_volume, createsrc_builtin_storage_volumeon the target cluster. - It is recommended to use temporary credentials (access key / secret key) for the source storage volume. These can be revoked after migration is complete.
- Set
Migrate range-distributed tables
Range-distributed table migration is supported only between shared-data clusters. The migration tool creates a missing target table automatically from the source table definition. Do not create the target table manually. Record the original values of the following FE configurations. For each dynamic setting, also add the matching persistent setting to fe.conf on every applicable FE so that an FE restart does not change the migration contract.-
On both the source and target clusters, disable tablet merge and keep range distribution enabled:
-
enable_execute_script_on_frontendis a static configuration. Set it totruein fe.conf on every source and target FE, and restart the FEs before the migration window. -
On the target cluster, disable automatic tablet split and merge by setting the target size to
0:Do not use a very large value instead. The tool creates target tables from the source table definitions, so a source table with the table propertytablet_reshard_target_sizekeeps it on the target, and that table property would take the place of the large value for the table.0disables automatic split and merge for every table. The splits submitted by the tool use explicit boundaries and do not depend on this configuration. -
Before starting the tool, run the following query separately on the source and target clusters:
Start migration only when this query returns no relevant rows on either cluster. This waits for every non-final merge state, including
PENDING,PREPARING,RUNNING,CLEANING, andABORTING. Keep source automatic split enabled so that the source topology can evolve. Do not run independent writes or pre-split operations on the target while migration is active.
ADMIN EXECUTE ON FRONTEND calls. The complete range value for each tablet contains lowerBound, lowerIncluded, upperBound, and upperIncluded. A null endpoint means negative or positive infinity. In a finite multi-column endpoint list, a null cell means SQL NULL; every other cell is a canonical string value. This representation preserves both inclusion flags and distinguishes a literal string NULL from SQL NULL. Although the bridge retains this complete representation for future extension, the current FE-to-BE split path accepts only half-open [lower, upper) child ranges.
ADMIN EXECUTE ON FRONTEND is not forwarded to another FE. The tool must discover and connect to each cluster’s Leader FE, and the migration users need the SYSTEM-level OPERATE privilege. FE scripts are privileged code: use a dedicated trusted account, protect its credentials, and pass generated script parameters as properly escaped JSON inside one SQL string. The DDL executor must send the complete ADMIN statement without splitting it at semicolons. After migration, restore the recorded static script-execution setting as described below.
For each range-distributed table, the tool compares freshly read source and target topologies. If they differ, the tool stops generating new replication jobs for that table but lets queued, sending, and target-running jobs finish. After all such jobs and replication transactions have drained, it submits an exact-boundary tablet split through the existing DDL queue. Replication resumes only after another topology read proves that source and target ranges are structurally equal.
Range distribution does not change shared-data version synchronization. Each replication uses the source physical partition’s visibleVersion, compares the complete metadata and file sets, and skips files that already exist on the target.
When transparent data encryption (TDE) is used in shared-data-to-shared-data migration, a newly copied private standalone physical file is read with its source encryption metadata and then re-encrypted under the target policy. If the source key hierarchy cannot be unwrapped, migration fails before the target publication. Newly copied shared or bundled physical files are unsupported when the source file is encrypted or target TDE is enabled. Objects that already exist on the target can be reused directly and retain their target encryption metadata. Migration from a shared-nothing source to a shared-data target fails closed when a source rowset or DCG file is encrypted; decrypting and re-encrypting those files on this path is not supported.
Warning
This workflow supports split convergence only. It fails closed if convergence would require a target merge, including a source merge, a target-only boundary, crossing ranges, or a target topology finer than the source topology. Range-colocate layouts are also unsupported.
After migration, first wait for the tool, replication jobs and transactions, and tablet reshard jobs to drain. Restore dynamic configurations, including the source and target merge setting and the target tablet size, with ADMIN SET FRONTEND CONFIG, and restore their recorded values in fe.conf. Restore automatic reshard behavior only if it was enabled before migration; otherwise keep it disabled. Separately restore the recorded static enable_execute_script_on_frontend value in fe.conf on every FE and restart the FEs. Disable script execution only if its recorded value was false or you intentionally choose a stricter post-migration security policy.
Enable Legacy Compatibility for Replication
The database may behave differently between the old and new versions, causing problems during cross-cluster data migration. Therefore, you must enable Legacy Compatibility for the target cluster before data migration and disable it after data migration is completed.-
You can check whether Legacy Compatibility for Replication is enabled by using the following statement:
If
trueis returned, it indicates that Legacy Compatibility for Replication is enabled. -
Dynamically enable Legacy Compatibility for Replication:
-
To prevent Legacy Compatibility for Replication from automatically disabling during the data migration process in case of cluster restart, you also need to add the following configuration item in the FE configuration file fe.conf:
enable_legacy_compatibility_for_replication = true from the configuration file, and dynamically disable Legacy Compatibility for Replication using the following statement:
Configure Data Migration (Optional)
You can configure data migration operations using the following FE and BE parameters. In most cases, the default configuration can meet your needs. If you wish to use the default configuration, you can skip this step. Note Please note that increasing the values of the following configuration items can accelerate migration but will also increase the load pressure on the source cluster.FE Parameters
The following FE parameters are dynamic configuration items. Refer to Configure FE Dynamic Parameters on how to modify them.BE Parameters
The following BE parameter is a dynamic configuration item. Refer to Configure BE Dynamic Parameters on how to modify it.Step 1: Install the Tool
It is recommended to install the migration tool on the server where the target cluster resides.-
Launch a terminal, and download the binary package of the tool.
-
Decompress the package.
Step 2: Configure the Tool
Migration-related configuration
Navigate to the extracted folder and modify the configuration file conf/sync.properties.
Migrate from Shared-nothing
Obtain Cluster Token
Note The Cluster Token is not required for migration between shared-data clusters. You can skip this step if you want to migrate data between shared-data source clusters. The Cluster Token is stored in<image_dir>/VERSION. Here, <image_dir> is the non-empty image_dir configured in fe.conf, or <meta_dir>/image when image_dir is unset or empty. Log in to the server where the FE node is located, replace <image_dir> with that resolved path, and run the following command:
Map storage volumes
When the migration tool creates a table on the target cluster, it determines the table’s storage volume as follows (in order of precedence):- If
target_cluster_use_builtin_storage_volume_onlyis set totrue,builtin_storage_volumeis used for all tables. - If
target_cluster_storage_volumeis set to a specific storage volume, the specified storage volume is used for all tables. - Otherwise, by default, the source table’s storage volume property is reserved. Tables from different source storage volumes are created under the corresponding storage volumes on the target cluster, provided those storage volumes exist on the target.
src_-prefixed storage volumes serve a different purpose: they are used only during migration to give target CNs read access to the source cluster’s object storage. After migration is complete, the src_<name> volumes are no longer needed and can be dropped.
Network-related configuration (Optional)
Migrate from Shared-nothing During data migration, the migration tool needs to access all FE nodes of both the source and target clusters, and the target cluster needs to access all BE and CN nodes of the source cluster. You can obtain the network addresses of these nodes by executing the following statements on the corresponding cluster:<host> must match the address shown in the IP column returned by SHOW FRONTENDS, SHOW BACKENDS, or SHOW COMPUTE NODES.
The following example performs these operations:
- Map the source cluster’s private network addresses
192.1.1.1and192.1.1.2to10.1.1.1and10.1.1.2. - Map the source cluster’s FE ports
8030and9030to38030and39030on10.1.1.1. - Map the target cluster’s private network address
fe-0.starrocks.svc.cluster.localto10.1.2.1and remap port9030.
<host> must match the address shown in the IP column returned by SHOW FRONTENDS.
The following example maps the target cluster’s internal Kubernetes FQDN to a reachable IP:
Synchronize users, roles, and privileges (Optional)
By default, the migration tool does not synchronize account metadata. If you setenable_privilege_sync to true, the tool also synchronizes users, roles, and their privileges from the source cluster to the target cluster.
Each time the tool retrieves metadata, it reads the users, roles, and privileges of both clusters, compares them, and executes the DDL statements needed to make the target cluster consistent with the source cluster. User definitions are obtained using SHOW CREATE USER, which returns the password as ciphertext, so no plaintext password is handled during migration.
The following objects are never modified by the migration tool:
rootand the user specified intarget_cluster_user. Overwriting the password of the target cluster’srootwould lock out its operators, and dropping the account that the tool uses to connect would break the tool’s own connection.- The immutable built-in roles
root,db_admin,cluster_admin,user_admin, andsecurity_admin. Thepublicrole is built-in but mutable, so its privileges are synchronized while the role itself is left alone. - The users specified in
privilege_sync_exclude_usersand the roles specified inprivilege_sync_exclude_roles.
- The FE of both clusters must support
SHOW CREATE USER. If the FE of either cluster does not support this statement, users and their privileges are skipped, and only roles and role privileges are synchronized. - The progress of privilege synchronization is printed to the log file log/sync.INFO.log with the prefix
Sync privilege progress. It lists the status of each of the four units: roles, role privileges, users, and user privileges. - In one-time synchronization mode (
one_time_run_mode=true), the tool exits successfully only after privileges have also converged. It exits with a failure if either cluster does not supportSHOW CREATE USER, or if privileges remain inconsistent across three consecutive comparisons.
Step 3: Start the Migration Tool
After configuring the tool, start the migration tool to initiate the data migration process.- If you are migrating data from a shared-nothing cluster, make sure that the BE nodes of the source and target clusters can properly communicate via the network.
- During runtime, the migration tool regularly checks whether the data in the target cluster is lagging behind the source cluster. If there is a lag, it initiates data migration tasks.
- If new data is constantly loaded into the source cluster, data synchronization will continue until the data in the target cluster is consistent with that in the source cluster.
- You can query tables in the target cluster during migration, but do not load new data into the tables, as it may result in inconsistencies between the data in the target cluster and the source cluster. Currently, the migration tool does not forbid data loading into the target cluster during migration.
- Note that data migration does not automatically terminate. You need to manually check and confirm the completion of migration and then stop the migration tool.
View Migration Progress
View Migration Tool logs
You can check the migration progress through the migration tool log log/sync.INFO.log. Example 1: View task progress.
Sync job progress: The progress of data migration. The migration tool regularly checks whether the data in the target cluster is lagging behind the source cluster. Therefore, a progress of 100% only means that the data synchronization is completed within the current check interval. If new data continues to be loaded into the source cluster, the progress may decrease in the next check interval.total: The total number of all types of jobs in this migration operation.ddlPending: The number of DDL jobs pending to be executed.jobPending: The number of pending data synchronization jobs to be executed.sent: The number of data synchronization jobs sent from the source cluster but not yet started. Theoretically, this value should not be too large. If the value keeps increasing, please contact our engineers.running: The number of data synchronization jobs that are currently running.finished: The number of data synchronization jobs that are finished.failed: The number of failed data synchronization jobs. Failed data synchronization jobs will be resent. Therefore, in most cases, you can ignore this metric. If this value is significantly large, please contact our engineers.unknown: The number of jobs with an unknown status. Theoretically, this value should always be0. If this value is not0, please contact our engineers.

Sync table progress: Table migration progress, that is, the ratio of tables that have been migrated in this migration task to all the tables that need to be migrated.finishedTableRatio: Ratio of tables with at least one successful synchronization task execution.expiredTableRatio: Ratio of tables with expired data.total table: Total number of tables involved in this data migration progress.finished table: Number of tables with at least one successful synchronization task execution.unfinished table: Number of tables with no synchronization task execution.expired table: Number of tables with expired data.
View Migration Transaction Status
The migration tool opens a transaction for each table. You can view the status of the migration for a table by checking the status of its corresponding transaction.<db_name> is the name of the database where the table is located.
View Partition Data Versions
You can compare the data versions of the corresponding partitions in the source and target clusters to view the migration status of that partition.<table_name> is the name of the table to which the partition belongs.
View Data Volume
You can compare the data volumes in the source and target clusters to view the migration status.View Table Row Count
You can compare the row counts of tables in the source and target clusters to view the migration status of each table.After Migration
WhenSync job progress has been stable at 100% and your business is ready to switch, complete the cutover as follows:
- Stop writes to the source cluster.
-
Verify
Sync job progressreaches and remains at 100% after writes stop. - Stop the migration tool.
- Point your applications to the target cluster address.
-
If you migrated data between shared-data clusters, restore the Auto-Vacuum setting on the source cluster:
-
If you migrated data between shared-data clusters, re-enable Compaction on the target cluster. Remove
lake_compaction_max_tasks = 0from fe.conf and execute: -
Disable Legacy Compatibility for Replication on the target cluster. Remove
enable_legacy_compatibility_for_replication = truefrom fe.conf and execute:
Limits
The list of objects that support synchronization currently is as follows (those not included indicate that synchronization is not supported):- Databases
- Internal tables and their data
- Materialized view schemas and their building statements (The data in the materialized view will not be synchronized. And if the base tables of the materialized view is not synchronized to the target cluster, the background refresh task of the materialized view reports an error.)
- Logical views
- Users, roles, and their privileges (not synchronized by default, enabled by
enable_privilege_sync)
- The target cluster must be running on v4.1 or later.
- Migration from a shared-data cluster to a shared-nothing target is not supported.
- Each storage volume used by the source cluster’s tables must have a corresponding
src_<volume_name>storage volume pre-created on the target cluster.