Synchronizing Data from TiDB 4.0.13 to TiDB 6.5 Using CDC

Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.

Original topic: tidb4.0.13版本通过cdc同步数据到tidb6.5版本

| username: 路在何chu

【TiDB Usage Environment】Production Environment 4013
【Reproduction Path】What operations were performed when the issue occurred
Want to perform a synchronization upgrade from a lower version to a higher version
【Encountered Issue: Issue Symptoms and Impact】
Has anyone done this before? What issues might arise?

| username: oceanzhang | Original post link

You should ask when you encounter a problem. Haha.

| username: oceanzhang | Original post link

Each customer’s environment is different.

| username: 路在何chu | Original post link

Not sure if this will cause any issues, so I’m doing some preliminary research.

| username: Daniel-W | Original post link

I have only worked with 5.x and synchronized it to 6.x through binlog.

| username: 路在何chu | Original post link

I plan to upgrade a TiDB cluster this way next year, not sure if it will work.

| username: xfworld | Original post link

There are many pitfalls with ticdc in version 4.x, but you can give it a try.

However, ticdc only handles incremental data, and existing data will have to be transferred using other methods.

| username: Billmay表妹 | Original post link

It is recommended to upgrade the 4.x cluster to 6.x before synchronizing.

| username: 这里介绍不了我 | Original post link

Have you worked on 6 to 5?

| username: 路在何chu | Original post link

In theory, it should be possible because our CDC also synchronizes to MySQL 8.0 for full synchronization. TiDB’s compatibility should be better than MySQL, right?

| username: Kongdom | Original post link

:thinking: Are you looking to perform cross-version data synchronization or cross-version upgrades?

| username: 路在何chu | Original post link

Cross-version synchronization, then stop the business, switch and upgrade.

| username: 路在何chu | Original post link

You can also test the switch first this way.

| username: wangccsy | Original post link

Directly upgrade to 7.5.

| username: tidb菜鸟一只 | Original post link

Just give it a try, and address any issues as they arise. At least it won’t affect your current database.

| username: xingzhenxiang | Original post link

I feel that the binlog method is still better in this version, as TiCDC is just getting started in this version.

| username: kkpeter | Original post link

We didn’t encounter any issues during our migration.

| username: Jellybean | Original post link

For TiDB v4.0.13, it is strongly recommended to use TiCDC v4.0.16 or later versions. Otherwise, there is a risk of PD crashing due to rapid consumption of metadata space by etcd when synchronizing large amounts of data.

We have performed synchronization from v4.0.2 to v5.4 and verified that versions of TiCDC v4.0.16 and later are relatively stable.

Currently, it is strongly recommended that you simulate business load access scenarios in your own testing environment and fully verify before executing in production.

| username: Kongdom | Original post link

In this situation, we generally perform a backup and restore with the same version, then upgrade. Alternatively, we directly upgrade in place.

| username: TiDBer_vfJBUcxl | Original post link

Stop the business, back up, and upgrade in place.