This topic introduces the supported operations for schema migration in a data migration task. You can choose Schema Migration in the Select Type & Objects step when creating your migration task.
Background information
A schema migration task migrates data objects such as tables, indexes, constraints, comments, and views from the source database to the target database, and automatically filters out temporary tables. When the source database is not OceanBase Database, the data types and SQL syntax are automatically converted and assembled according to the syntax definition standards of the target tenant of OceanBase Database, and then replicated to the target database.
The migration task starts schema migration after passing the pre-check. On the Schema Migration tab of the task details page, you can view the current state, the start and end time, total elapsed time, and the migration progress of the tables and views of the schema migration task.
When the schema migration task is in the Running or Failed state, you can perform different operations on the migration objects, as shown below. When the schema migration task is in the Completed state, you can only view the syntax of creating the migration objects.
| State | Supported operation |
|---|---|
| Initializing | - |
| DDL statements obtained, Creating, and To be executed | View |
| Completed, Completed (with conversion), and Skipped | Remove and View |
| Failed | Retry, Skip, Remove, Modify, and View Details |
| Failed to obtain the DDL statement | Retry, Skip, Modify, and View |
| Unsupported Note: This status normally occurs when there is an object creation syntax in the source database that is not supported by the target database. |
Skip, Remove, Modify, and View |
Prerequisites
You have created and started a data migration task. For more information, see the topic about creating a data migration task between the corresponding data sources in Data migration.
Limitations
Only users with the Project Owner, Project Admin or Data Services Admin project roles are allowed to retry/retry all failed objects, skip and remove target objects, and modify creation syntax.
The operations introduced in this topic apply to schema migration tasks in the Running or Failed state. For schema migration tasks in the Completed state, you can only view the syntax of creating the migration objects.
Schema migration supports migrating tables, indexes, views, comments, and check constraints, but does not support migrating foreign keys, temporary tables, events, types, functions, procedures, or other objects or constraints.
Retry a single failed object or all failed objects
For migration objects in the Failed or Failed to obtain the DDL statement state, you can retry one or all of them at a time. You can directly retry an object, or retry an object after modifying it.
Retry a single failed object: On the Schema Migration page, click Retry in the Action column of the failed object.
Retry all failed objects
On the Schema Migration page, click Retry All Failed Objects in the upper-right corner of the page.
In the dialog box that appears, click OK.
Skip an object
You can skip an object in the Failed, Failed to obtain the DDL statement, or Unsupported state.
Notice
- The prerequisite for skipping is that you have prepared the corresponding migration object in the target database. If the corresponding migration object is not in the target database, skipping will result in an error in the Full Migration step.
- Once skipped, the target object will not be migrated in the current data migration task. Proceed with caution.
On the Schema Migration page, click Skip in the Action column of the target object.
In the dialog box that appears, click OK.
On the Schema Migration page, click Remove in the Action column of the target object.
In the dialog box that appears, click OK.
On the Schema Migration page, choose More > Modify in the Action column of the target object.
In the Modify Table Creation Syntax dialog box, check the failed DDL statement and the error message, and modify the definition of the conversion result of the statement.
Click Save.
On the Schema Migration page, choose More > View Details in the Action column of the target object.
In the View Details dialog box, view the cause of the failure.
To skip a target object, perform the following operations:
Remove an object
You can remove an object in the Failed, Completed, Completed (with conversion), Skipped, Failed to obtain the DDL statement, or Unsupported state.
Notice
After an object is removed, the current migration task does not migrate this object anymore. Proceed with caution.
Modify the creation syntax of an object
You can modify the syntax used to create an object if the object is in the Failed or Failed to obtain the DDL statement state.
View the creation syntax of an object
You can view the syntax used to create an object if the object is in an state other than Initializing and Failed.
On the Schema Migration page, you can view the syntax by clicking View in the Action column of the target object. If the table creation syntax is fully compatible, the DDL syntax executed is displayed. If it is not fully compatible, the converted syntax is displayed.
View the failure details of an object
For an object in the Failed state, you can view the details of its failure.