tencent cloud

Feedback

Incremental Migration Check

Last updated: 2024-11-04 10:50:08

    Check Details

    If you select incremental migration as the migration type, you need to check the following conditions; otherwise, the verification will fail.
    The wal_level of the source database must be logical.
    The max_replication_slots and max_wal_senders parameters in the source database must be greater than the total number of databases to be migrated (retain extra connections).
    The persistence attribute of the tables to be migrated in the source database must be p (permanent tables); otherwise, replication is not supported, and hence logical migration is not possible.
    The tables to be migrated should not include unlogged tables; otherwise, they cannot be migrated.
    It is recommended to migrate tables with primary keys. Otherwise, inconsistent data results may occur. You are advised not to migrate tables without primary keys.
    If the table to be migrated has no primary key and does not contain a replica identity (that is, the REPLICA IDENTITY attribute is set to NOTHING), the verification task will report a warning.
    If the table to be migrated has no primary key and includes field types that cannot use the = operator (json/point/polygon/txid_snapshot/xml), the verification will fail. You need to modify the table without a primary key as prompted or deselect the primary key table option; otherwise, the task cannot proceed.

    Fixing Method

    Modifying the wal_level/max_replication_slots/max_wal_senders Parameters

    The method to modify the parameters wal_level, max_replication_slots, and max_wal_senders is as follows.
    1. Log in to the source database.
    Note:
    If the source database is a self-built database, you need to log in to the server where the database runs and go to the main directory of the database data, which is usually $PGDATA.
    If the source database is in another cloud, modify the parameters as requested by the corresponding cloud vendor.
    If you need to modify the parameters of the target instance, submit a ticket through Online Support for assistance.
    2. Usually, open the postgresql.conf file and modify the corresponding parameters.
    wal_level = logical
    max_replication_slots = 10 //Modify according to actual needs.
    max_wal_senders = 10 //Modify according to actual needs.
    3. After the modification is completed, restart the database instance.
    4. Log in to the database instance and run the following command to check whether the parameters are correctly set:
    postgres=> select name,setting from pg_settings where name='wal_level';
    name | setting
    -----------+---------
    wal_level | logical
    (1 row)
    postgres=> select name,setting from pg_settings where name='max_replication_slots';
    name | setting
    -----------------------+---------
    max_replication_slots | 10
    (1 row)
    postgres=> select name,setting from pg_settings where name='max_wal_senders';
    name | setting
    -----------------+---------
    max_wal_senders | 10
    (1 row)
    5. Perform the verification task again.

    Modifying the REPLICA IDENTITY Attribute of the Table to Be Migrated

    It is generally not recommended to migrate tables without primary keys, as this may lead to data inconsistencies. If the table to be migrated has no primary key and does not contain a replica identity (that is, the REPLICA IDENTITY attribute is set to NOTHING), the verification task will report a warning.
    If a warning is reported, you are advised to modify the attribute parameters of the table as follows.
    ALTER TABLE schemaName.tableName REPLICA IDENTITY FULL;
    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