tencent cloud

Feedback

Migrating Advanced Object

Last updated: 2023-11-21 20:39:45

    Overview

    You can use DTS to migrate advanced objects, including functions, triggers, procedures, and events. The migration of advanced objects is a one-time operation. You can only migrate the advanced objects that are in the source database before the task is started, while those added to the source database after the task is started will not be synced to the target database.
    Note
    Currently, advanced objects can be migrated among MySQL, TDSQL-C for MySQL, MariaDB, and Percona.

    Application Scope

    The migration of advanced objects is only supported for NewDTS.

    Note

    We recommend that you not rename tables when migrating advanced objects; otherwise, the migration may fail.
    As the failure to migrate advanced objects does not affect the entire migration task, the success of the entire migration task does not necessarily mean that the advanced objects are also successfully migrated. Therefore, we recommend that you check whether they are migrated on the Task Progress page after the migration is completed.
    When procedures and functions are migrated, DTS will check whether user1 corresponding to DEFINER ([DEFINER = user1]) in the source database is the same as the migration account user2, and if not, DTS will change the SQL SECURITY attribute of user1 in the target database from DEFINER to INVOKER ([INVOKER = user1]) after the migration, and set the DEFINER in the target database to the migration account user2 ([DEFINER = migration account user2]).
    Procedures and functions will be migrated during source database export. If there are no incremental migration tasks, triggers and events will be migrated when the task stops; otherwise, they will be migrated after you click Complete, in which case the transition will take a longer time.
    For cross-version migration, if the sql_mode set for the advanced objects in the source database is not supported by the target database, sql_mode will be changed to NO_AUTO_VALUE_ON_ZERO after the advanced objects are migrated.
    When migrating triggers and events, you need to grant the migration account the TRIGGER and EVENT permissions of the source database.
    If there is ''' (escaping) in the definitions of the selected advanced objects, a MySQL constraint will be encountered, which will cause the migration task to fail. We recommend that you not select such advanced objects.

    Directions

    1. On the data migration task list page, click Configure in the Operation column of the target task. On the Set migration options and select migration objects page, you can determine whether to migrate advanced objects. By default, the advanced objects are not selected for migration. You can select them as needed.
    
    2. The advanced object check item will be added to the verification task. For more information, see Advanced Object Check.
    Contact Us

    Contact our sales team or business advisors to help your business.

    Technical Support

    Open a ticket if you're looking for further assistance. Our Ticket is 7x24 avaliable.

    7x24 Phone Support