Migration job organization and scheduling
MaxCompute Migration Service (MMS) lets you create migration jobs for a specified scope, such as a database, table, or partition, and intelligently allocates migration tasks. This topic describes how migration jobs are organized and scheduled.
Task assignment
Key concepts
migration job
The largest logical unit for a migration, defined by a migration scope, such as an entire database, a specific set of tables, or partitions.
migration task
The smallest, independently schedulable unit of execution. MMS automatically splits a migration job into one or more parallel migration tasks based on the job's scope and assignment rules.
Organizational structure
A migration job can specify a database, multiple tables, or multiple partitions as its migration scope.
NoteThe service does not re-migrate non-partitioned tables or partitions if they have already been migrated and their source data is unchanged.
A migration job contains one or more migration tasks.
A migration task migrates either one non-partitioned table or one or more partitions from a single partitioned table.

Task assignment rules
After a migration job is created, the system splits tables and partitions into migration tasks in two steps: data filtering and data grouping.
Step 1: Data filtering
The system filters non-partitioned tables and partitions from the job's specified scope to determine the actual objects for migration. An object is selected for migration if it meets all of the following conditions:
Its status meets either of the following criteria:
The migration status is not
succeeded.The migration status is
succeeded, but the source data has been updated.NoteLogic for determining if source data is updated:
When metadata is refreshed, MMS pulls metadata (databases, tables, and partitions) from the data source and caches it. MMS then compares the latest cache with the previous one. If specific metadata has changed, the corresponding table or partition is marked as data updated.
Metadata attributes for comparison:
non-partitioned table: The
tableSchema,size,numRows,lastDdlTime, andtypeattributes are compared. If any of these differ, the table is marked as data updated.partitioned table: The
size,numRows, andlastDdlTimeattributes are compared. If any of these differ, the partition is marked as data updated.
Source of attribute values for different data sources:
BigQuery uses
total_logical_bytesandtotal_rowsas the values forsizeandnumRows, respectively.Hive uses the
metastore table propertyvaluesrawDataSizeandnumRowsfor size and numRows, respectively.Databricks delta tables also use
lastUpdateVersionfor comparison.For MaxCompute,
lastDdlTimeis derived fromlast_data_modified_time.
It matches the allowlist/denylist configuration of the data source and the partition filtering rules of the migration job.
Step 2: Data grouping
The system uses different task assignment strategies based on the table type:
non-partitioned table
Each non-partitioned table is assigned to a separate migration task.
partitioned table
The system groups partitions from the same partitioned table into one or more migration tasks based on two settings in the data source configuration: maximum number of partitions per task and maximum data size per task (GB). A new task is created when either threshold is met.
Example of task assignment for a partitioned table:
Example 1: If the maximum number of partitions per task is set to 1, each migration task will contain only one partition.
Example 2: If the maximum number of partitions per task is set to 100 and the maximum data size per task (GB) is set to 1, and a partitioned table contains two partitions, each larger than 1 GB, the system creates two migration tasks for this table. Each task contains one partition.
Usage examples
Example 1: Create a database migration job
Assume you create a migration job to migrate a database named database_a, which contains the following tables:
Non-partitioned tables:
table_aandtable_bPartitioned tables:
table_c(with 100 partitions, each 10 KB in size) andtable_d(with 2 partitions, each 10 GB in size)
When you submit the migration job, the data source has the following settings: maximum number of partitions per task=50, maximum data size per task (GB)=5.
The system generates the following migration tasks:
Task 1: Migrates
table_aTask 2: Migrates
table_bTask 3: Migrates partitions 1-50 of
table_cTask 4: Migrates partitions 51-100 of
table_cTask 5: Migrates partition 1 of
table_dTask 6: Migrates partition 2 of
table_d

Example 2: Incremental migration
After the initial migration of database_a, the following changes occur at the source:
New data is inserted into the non-partitioned table
table_b.A new non-partitioned table
table_eis added.The partitioned table
table_dis deleted.For the partitioned table
table_c:New data is inserted into partition pt_100.
Partition pt_99 is deleted.
Partition pt_101 is added.
A new partitioned table
table_fis added with no partitions.
When you create another migration job for database_a, the system generates the following migration tasks:
Task 1: Migrates
table_bTask 2: Migrates partitions pt_100 and pt_101 of
table_cTask 3: Migrates the table schema of
table_f

Migration statuses
Migration job status
Status | Description | Trigger condition |
pending | The job has been created and is awaiting scheduling. | The initial status after a job is successfully created. |
running | At least one task in the job is running. | A migration task in the job starts to run. |
succeeded | All tasks in the job have succeeded. | All migration tasks have a status of |
failed | An error occurred during job execution. | All migration tasks have finished running, and at least one has failed. |
stopped | The job has been stopped manually. | The job is stopped manually. |
Migration job status workflow:

Migration task status
Status | Description | Trigger condition |
pending | The task has been created and is awaiting execution. | The initial status after a task is successfully created. |
running | The task is actively migrating data. | The task starts migrating data. |
succeeded | The task has successfully migrated its assigned data. | The task completes the migration of its assigned data. |
failed | An error occurred during task execution. | An exception occurs during data migration. |
stopped | The task has been stopped. | The parent job is stopped while the task is |
Migration task status workflow:

Table status
Status | Description | Applicable objects |
not migrated | The table has not yet started migrating. | Non-partitioned tables, partitioned tables |
migrating | The table is being migrated. | Non-partitioned tables, partitioned tables |
partially completed | Some, but not all, partitions of the table have migrated successfully. | Partitioned tables only |
succeeded | The table has been successfully migrated. | Non-partitioned tables; partitioned tables where all partitions have succeeded |
failed | An error occurred during the table migration. | Non-partitioned tables, partitioned tables |
The
partially completedstatus does not apply to non-partitioned tables.A partitioned table's status changes to
succeededonly after all its partitions have succeeded.
Non-partitioned table status workflow

Partitioned table status workflow

Partition status
Status | Description | Trigger condition |
not migrated | The partition has not yet started migrating. | The initial status when the partition is identified for migration. |
migrating | The partition is being migrated. | The task that contains the partition starts running. |
succeeded | The partition has been successfully migrated. | The task that contains the partition succeeds. |
failed | An error occurred during the partition migration. | The task that contains the partition fails. |
Partition status workflow:

Retry on failure
You can retry a migration job that is failed. After you click Retry, the job status does not change immediately. The status updates only after the failed tasks are rescheduled and begin to run.
The retry operation re-runs only the failed tasks. Succeeded tasks are not re-run.
Impact of changing the destination on status
If you change the migration destination for a database, table, or partition, the system resets the status of the affected tables and partitions to not migrated.
After you change the destination, the original migration tasks no longer update the status of the affected objects.
FAQ
Incremental synchronization after migration
Scenario 1: Synchronize new or modified tables and partitions in a database
On the data source management page, resynchronize the metadata.
Resubmit the migration job for the specific database.
NoteBased on the data filtering rules, the migration job migrates only new and modified tables and partitions.
Scenario 2: Synchronize new or modified partitions in a specific table
On the data source management page, resynchronize the metadata.
Resubmit the migration job for the specific table.
Re-migrating succeeded tables or partitions
To re-migrate a succeeded table or partition whose source data has not changed, follow these steps:
In the Table List or Partition List, select the objects that you want to re-migrate.
Reset their status to
not migrated.Resubmit the migration job.

