All Products
Search
Document Center

Data Management:Synchronize schemas

Last Updated:Mar 28, 2026

Schema synchronization compares the schemas of two databases, generates the DDL statements needed to close the gap, and executes those statements against the destination database — all without touching any row data.

Use schema synchronization to keep schemas consistent across environments: production-to-test, test-to-test, or production-to-production.

Prerequisites

Before you begin, make sure you have:

Note

Without the Enable execution capability security rule, DMS can compare schemas but cannot execute the generated SQL statements.

Supported database types

EngineSupported products
MySQLApsaraDB RDS for MySQL, PolarDB for MySQL, ApsaraDB MyBase for MySQL, PolarDB-X, AnalyticDB for MySQL V3.0, MySQL databases from other sources
SQL ServerApsaraDB RDS for SQL Server, ApsaraDB MyBase for SQL Server, SQL Server databases from other sources
PostgreSQLApsaraDB RDS for PostgreSQL, PolarDB for PostgreSQL, ApsaraDB MyBase for PostgreSQL, AnalyticDB for PostgreSQL, PostgreSQL databases from other sources
MariaDBApsaraDB RDS for MariaDB, MariaDB databases from other sources
OceanBaseApsaraDB for OceanBase in MySQL mode
PolarDBPolarDB for PostgreSQL (Compatible with Oracle)

How schema synchronization works

Schema synchronization only changes structure — it never moves data between databases.

When DMS compares schemas, the outcome depends on whether matching table names exist in the destination:

SituationDMS behavior
Table exists in source but not in destinationCreates the table in the destination database
Table exists in both databasesAdds or removes fields to make the destination table match the source
Table exists in destination but not in sourceNo action — DMS never deletes a table from the destination
Warning

Removing a field also permanently deletes all data in that field. Review the generated SQL statements carefully before confirming synchronization.

Synchronize schemas

The workflow has four stages: configure the ticket → analyze schemas → get approval → execute synchronization.

Before you start: Schedule schema synchronization during off-peak hours. Synchronization duration depends on the number of tables and the current task queue.

  1. Log on to the DMS console V5.0.

  2. In the top navigation bar, choose Database Development > Schema Change > Schema Synchronization.

    Note

    In simple mode, hover over the 2023-01-28_15-57-17.png icon in the upper-left corner and choose All Features > Database Development > Schema Change > Schema Synchronization.

  3. On the Table Sync Tickets page, configure the following parameters:

    Warning

    Choosing Ignore may cause DDL statements to be skipped, resulting in an incomplete or inconsistent synchronization. Review carefully before selecting this option.

    ParameterDescription
    Source databaseThe source database for schema synchronization. Enter a keyword to search. (Optional) Specify a schema version number — the latest schema is used by default. See Manage schema versions.
    Destination databaseThe destination database for schema synchronization. Enter a keyword to search. (Optional) Specify a schema version number — the latest schema is used by default. See Manage schema versions.
    Synchronized tableThe tables to synchronize. Select Partial Tables to specify source and destination table names (destination defaults to the same name as the source), or All Tables to synchronize all tables in the source database.
    Whether to ignore errorHow to handle errors during SQL execution. Not Ignore stops execution when an error occurs. Ignore skips the failed statement and continues with the rest.
  4. Click Submit. DMS starts schema analysis. If schemas change during analysis, click Re-analyze in the Schema Analysis step.

  5. Click Submit for Approval and wait for the request to be approved.

  6. After approval, click Submit and Synchronize to Target Database.

  7. Review the SQL statements to be executed. Click Confirm Synchronization. After execution starts, click Details to view operation logs, including the SQL statements, execution duration, and scheduling details.

    Warning

    Check for any field deletions before proceeding — removing a field permanently deletes its data.

  8. When the Synchronized. message appears, schemas are successfully synchronized to the destination database.

What's next