tools/pika_migrate/pika-migrate_en.md
Pika 4.0, standalone mode, single DB only.
Online migration of data from Pika to Pika or Redis (supports full and incremental synchronization).
The previously official pika_to_redis tool provided by the Pika project only supported offline migration of data from Pika's DB to Pika or Redis, and did not support incremental synchronization. This tool is essentially a special Pika instance: after becoming a replica, it internally forwards data received from the primary to Redis while also supporting incremental synchronization, enabling hot (live) migration.
dbsync request to obtain the current full DB data of the primary, along with the binlog position corresponding to the current DB data.###################
## Migrate Settings
###################
target-redis-host : 127.0.0.1
target-redis-port : 6379
target-redis-user :
target-redis-pwd :
sync-batch-num : 100
redis-sender-num : 10
config set expire-logs-nums 10000 on the primary to keep 10,000 binlog files. (Binlog files consume disk space; adjust the retention count based on your actual situation.) This ensures that the corresponding binlog files still exist when this tool requests incremental synchronization later.target-redis-host, target-redis-port, target-redis-pwd, sync-batch-num, and redis-sender-num. (sync-batch-num controls how many data entries are packed and sent together to Redis at once to improve forwarding efficiency after receiving full data from the primary. Additionally, redis-sender-num threads can be specified internally to forward commands; commands are distributed to different threads based on the hash value of the key, so there is no need to worry about data disorder caused by multi-threaded sending.)pika -c pika.conf and check the logs for any errors.slaveof ip port force on the tool to request synchronization from the primary, and observe whether there are any errors.info Replication on the primary. (You can also write a special key to the primary and check whether it can be immediately retrieved from Redis to determine whether data synchronization is essentially complete.)