tencent cloud

Feedback

Migrating Self-Built Databases to Tencent Cloud Databases via CCN

Last updated: 2024-09-10 17:49:43

    Overview

    This document describes how to use the data migration feature of DTS to migrate data from a self-built database to a TencentDB database through CCN.
    CCN can interconnect a VPC with another VPC or a local IDC. To use CCN access, you must establish cross-VPC and VPC-IDC interconnections through CCN in advance.
    In this scenario, you have used CCN to interconnect the three networks of VPC-Guangzhou, VPC-Chengdu, and VPC-Shanghai, have a self-built database in Guangzhou, and plan to migrate the data in the source database in Guangzhou to the target database in Nanjing. VPC-Chengdu is selected as the Accessed VPC.

    Prerequisites

    1. Prepare the target database.
    2. Prepare and authorize the account that will execute the DTS task.
    2.1 The source database must have the following permissions:
    Migration of the entire instance:
    CREATE USER 'migration account'@'%' IDENTIFIED BY 'migration password';
    GRANT RELOAD,LOCK TABLES,REPLICATION CLIENT,REPLICATION SLAVE,SHOW DATABASES,SHOW VIEW,PROCESS ON *.* TO 'migration account'@'%';
    GRANT ALL PRIVILEGES ON `__tencentdb__`.* TO 'migration account'@'%';
    GRANT SELECT ON *.* TO 'migration account';
    Migration of specified objects:
    CREATE USER 'migration account'@'%' IDENTIFIED BY 'migration password';
    GRANT RELOAD,LOCK TABLES,REPLICATION CLIENT,REPLICATION SLAVE,SHOW DATABASES,SHOW VIEW,PROCESS ON *.* TO 'migration account'@'%';
    GRANT ALL PRIVILEGES ON `__tencentdb__`.* TO 'migration account'@'%';
    GRANT SELECT ON `mysql`.* TO 'migration account'@'%';
    GRANT SELECT ON database to be migrated.* TO 'migration account';
    2.2 Permissions required of the target database: ALTER, ALTER ROUTINE, CREATE, CREATE ROUTINE, CREATE TEMPORARY TABLES, CREATE USER, CREATE VIEW, DELETE, DROP, EVENT, EXECUTE, INDEX, INSERT, LOCK TABLES, PROCESS, REFERENCES, RELOAD, SELECT, SHOW DATABASES, SHOW VIEW, TRIGGER, and UPDATE.

    Migration Using the Same-Account CCN

    Network Connectivity

    Same-Account CCN: This refers to using the CCN under the primary account of the target database to connect with the source database.
    
    
    
    1. Use CCN to establish network connectivity.
    1.1 Connect the user's source database to VPC1. For detailed instructions, see Establishing a Connection from VPC to IDC.
    1.2 Establish connectivity between VPC1 and VPC2. For detailed instructions, see Establishing interconnectivity between different networks under the same account through CCN.
    Note:
    CCN only provides bandwidth below 10 Kbps between all regions free of charge. However, DTS requires a higher bandwidth. Therefore, bandwidth configuration in the link is required.

    Purchasing the DTS Task

    1. Log in to the DTS console, select Data Migration on the left sidebar, and click Create Migration Task to enter the Create Migration Task page.
    2. On the Create Migration Task page, select the types, regions, and specifications of the source and target instances and click Buy Now.
    For Source Instance Region , select the region where the source database's connected VPC (VPC2) is located, which is Chengdu. For Target Instance Region , select the region where the target database is located, which is Beijing.

    Configuring the DTS Task

    1. On the Set source and target databases page, configure the task, source database, and target database settings. After the source and target databases pass the connectivity test, click Create.
    In Source Database Settings, Access Type select "CCN",CCN Instance Account select "My Account",CCN Association VPC select "VPC2" and choose a subnet "subnet2"; In Target Database Settings, Access Type select "Database".
    CCN Association VPC refers to the VPC within the CCN that is connected to the DTS linkage. You need to select a VPC from all the VPCs connected through the CCN, excluding the VPC that the source database is connected to.
    When you select a subnet, if it cannot be pulled, it might be an account issue. The CCN Association VPC account and the DTS task account need to be the same. For example, if you want to migrate a database instance from Account A to Account B, the task should be created using Account B. Therefore, the CCN Association VPC should be under Account B.
    VPC Region: No configuration is required, but the region needs to match the region of the CCN associated VPC . If the user did not select the correct region when purchasing the DTS task, DTS will automatically adjust it to ensure the consistency.
    2. On the Set migration options and select migration objects page, configure the migration type and objects and click Save.
    3. On the task verification page, verify the task. After the verification is passed, click Start Task. If the verification failed, fix the problem as instructed in Database Connection Check and initiate the verification task again.
    Failed: It indicates that a check item fails and the task is blocked. You need to fix the problem and run the verification task again.
    Alarm: It indicates that a check item doesn't completely meet the requirements, and the task can be continued, but the business will be affected. You need to assess whether to ignore the alarm or fix the problem and continue the task based on the alarm message.
    4. Return to the data migration task list, and you can see that the task has entered the Creating status. After 1–2 minutes, the data migration task will be started.

    Cross-Account CCN Migration Operation

    Network Connectivity

    Cross-Account CCN: This involves connecting the source database using a CCN under a different Tencent Cloud account.
    
    
    
    1. Establish CCN network connectivity.
    1.1 Connect the user's source database to VPC1. For detailed instructions, see Establishing a Connection from VPC to IDC.
    1.2 Establish connectivity between VPC1 and VPC2. For detailed instructions, see Establishing interconnectivity between different networks under different accounts through CCN.
    Note:
    CCN only provides bandwidth below 10 Kbps between all regions free of charge. However, DTS requires a higher bandwidth. Therefore, bandwidth configuration in the link is required.

    Authorizing Cross-Account CCN (Optional)

    This step is required when using a CCN under a different account. It is not needed for the same-account CCN.
    1. Create a DTS role carrier, and select DTS_QCSRole as the role name. For detailed instructions, see Authorize DTS to access resources of other cloud services.
    2. Submit a ticket to apply, after which you will be able to use the CCN feature under a different account for data synchronization in the DTS console.

    Purchasing the DTS Task

    1. Log in to the DTS console, select Data Migration on the left sidebar, and click Create Migration Task to enter the Create Migration Task page.
    2. On the Create Migration Task page, select the types, regions, and specifications of the source and target instances and click Buy Now.
    For Source Instance Region , select the region where the source database's connected VPC (VPC2) is located, which is Chengdu. For Target Instance Region , select the region where the target database is located, which is Beijing.

    Configuring the DTS Task

    1. After the purchase is completed, the page will automatically redirect to the data migration task list. Select the task you just purchased to start configuration.
    2. On the set source and target database page, complete task settings, source database settings, and target database settings. Once the connectivity test between the source and target databases passes, click Save.
    In the source library settings, select CCN for Access Type, select Other Account for CCN Instance Account Type , and select VPC2 and a subnet, subnet2 for CCN Instance Association VPC. In the target library settings, select Database for Access Type.
    Note:
    Currently, to use a CCN under another account for a DTS task, you need to first submit a ticket to apply.
    3. On the Set migration options and select migration objects page, configure the migration type and objects and click Save.
    4. On the task verification page, verify the task. After the verification is passed, click Start Task. If the verification failed, fix the problem as instructed in Database Connection Check and initiate the verification task again.
    Failed: It indicates that a check item fails and the task is blocked. You need to fix the problem and run the verification task again.
    Alarm: It indicates that a check item doesn't completely meet the requirements, and the task can be continued, but the business will be affected. You need to assess whether to ignore the alarm or fix the problem and continue the task based on the alarm message.
    5. Return to the data migration task list, and you can see that the task has entered the Creating status. After 1–2 minutes, the data migration task will be started.
    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