Checking Details
When incremental migration is selected for the migration type, the following conditions must be checked; otherwise, the check fails.
The wal_level parameter of the source database must be set to logical.
The values of the max_replication_slots and max_wal_senders parameters of the source database must be greater than the total number of databases to be migrated (reserving additional connections).
The persistence property of the tables to be migrated in the source database must be set to p (permanent tables); otherwise, replication is not supported, and logical migration cannot be performed.
Unlogged tables cannot exist in the tables to be migrated; otherwise, migration cannot be performed.
It is generally not recommended to migrate tables without primary keys, as it may lead to data inconsistencies. If the tables to be migrated have no primary keys and the REPLICA IDENTITY property is not set to FULL, the check task will issue a warning.
If the tables to be migrated have primary keys and unique indexes, and the REPLICA IDENTITY property is not set to FULL, the check task will issue a warning.
If the tables to be migrated have no primary keys but have multiple unique indexes, and the REPLICA IDENTITY property is not set to FULL, the check task will issue a warning.
Fixing Methods
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 self-built, you need to log in to the server where the database is running and go to the primary data directory of the database, which is generally $PGDATA.
If the source database is hosted on another cloud platform, use the parameter modification methods specified by that platform.
If you need to modify the parameters of the target instance, request assistance via Online Support. 2. Generally, open the postgresql.conf file and modify the corresponding parameters.
wal_level = logical
max_replication_slots = 10 //Modify this parameter according to your actual situation.
max_wal_senders = 10 //Modify this parameter according to your actual situation.
3. After the modification is completed, restart the database instance.
4. Log in to the database instance and run the following commands to view whether the parameter values are set correctly:
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. Execute the check task again.
Modifying the REPLICA IDENTITY Property of the Table to Be Migrated
It is generally not recommended to migrate tables without primary keys, as it may lead to data inconsistencies. If the tables to be migrated have no primary keys and the REPLICA IDENTITY property is not set to FULL, the check task will issue a warning.
If the tables to be migrated have primary keys and unique indexes, and the REPLICA IDENTITY property is not set to FULL, the check task will issue a warning.
If the tables to be migrated have no primary keys but have multiple unique indexes, and the REPLICA IDENTITY property is not set to FULL, the check task will issue a warning.
If a warning occurs, it is recommended that users refer to the following methods to modify the property parameters of the table.
Note:
Modifying the REPLICA IDENTITY property of a table triggers a brief table lock, which may impact source database operations. It is recommended to perform this operation during off-peak hours.
If the warnings of the check task are ignored, Data Transfer Service (DTS) will automatically run the following command during migration.
ALTER TABLE schemaName.tableName REPLICA IDENTITY FULL;