tencent cloud

Feedback

Configure Physical Migration Tasks

Last updated: 2024-07-23 11:56:42
    Physical migration employs TencentDB for PostgreSQL physical streaming replication, which is faster and more stable. This document describes how to configure a physical migration task and related precautions.

    Configuring a Task

    2. In the left sidebar, select Data Migration.
    3. Go to the Data Migration task list. Click Create Migration Task, to set up a migration task with the source and target instance type as TencentDB for ostgreSQL.
    
    4. After creating the migration task, go to the migration task list, click Operation > Configure, to configure the newly created task.
    
    5. The configuration task involves three steps. Note that in the second step, the migration method needs to set to Physical migration. Select default for both migration type and migration object. Proceed to task verification afterward.
    
    6. For system verification details and repair methods, please see Physical migration check items.
    Note:
    If the source instance is a self-hosted TencentDB for PostgreSQL instance, be sure that the TencentDB for PostgreSQL data directory does not contain any other self-hosted files or directories. Otherwise, the procedure failure may occur.
    
    7. After all verifications pass, the task officially starts, and you can view the task details in the task list. The entire task involves seven steps, as shown in the figure:
    
    
    
    For detailed descriptions of the migration steps, see Migration steps explanation.

    Migration Steps Explanation

    1. Precheck

    Before initiating the migration task, the system performs multiple environmental checks on the source and target instances, including the following items:
    Target instance session checks: Checks if there are any user sessions on the target instance, and if yes, a system report error is raised. User sessions mainly refer to sessions initiated by accounts other than the following three types of database accounts.
    postgers
    repluser
    Accounts starting with tencentdb_
    Target instance database and table check: Checks if there are any user databases or objects on the target instance, and if yes, a system error is raised.
    Target instance associated instance checks: Checks if the target instance is already associated with any RO instances, and if yes, an error is raised.

    2. Data Backup

    To ensure the recoverability of data on the target instance, the system first performs a full automatic backup of the target instance. By using the native TencentDB for PostgreSQL tool pg_basebackup, it sets up a standby for the source instance in the Tencent Cloud PostgreSQL environment. Then, it is ready to start the primary-standby data synchronization. TencentDB for PostgreSQL Backup space is already billed, and costs incurred beyond the instance's complimentary space will be charged. For more details on charges, please see Backup space billing explanation.

    3. Full Migration

    Use the TencentDB for PostgreSQL physical streaming replication to implement full synchronization between the source instance and the standby instance on the Tencent Cloud PostgreSQL.

    4. Incremental Sync

    Use the TencentDB for PostgreSQL physical streaming replication to implement incremental synchronization between the source instance and the standby instance on the Tencent Cloud PostgreSQL. The master-standby synchronization progress in the task list needs to be observed in time. Once synchronization is achieved, be sure that the source instance needs to stop writing.
    
    
    

    5. Waiting for Switch

    When the difference in the master-standby incremental synchronization between the source instance and the standby instance on the Tencent Cloud PostgreSQL is 0, the system is waiting for a switch. You need to manually click Complete to initiate the switch.
    
    
    

    6. Switching

    After you click Complete, the system will switch the standby machine on the Tencent Cloud PostgreSQL to the master.
    Note:
    The system can execute the switch after detecting that the instant LSNs are the same on the source and target instances, but this does not means that the source instance has stopped writing. Please be sure that the source instance has ceased writing before proceeding with the switch.

    7. Completion

    After the switch, the standby machine acts as the master. The Tencent Cloud PostgreSQL management system will take over the new master and adapt to the corresponding management operations.

    Notes

    Instances must be master instances, read-only, and do not support physical migration.
    Physical replication does not support data transfer to or from sources or targets with Transparent Data Encryption (TDE) enabled.
    
    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