How does everyone upgrade TiDB?

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

Original topic: 大家都是如何进行TiDB的升级的?

| username: TiDBer_HErMeXDz

How does everyone upgrade TiDB?

  1. In-place upgrade using tiup. (Personally, I find it a bit of a black box and hard to control.)
  2. Use DM to migrate to a higher version of TiDB for the upgrade. (A bit more troublesome, but easier to manage.)
| username: xiaoqiao | Original post link

  1. First, create a cluster B with the same version.
  2. Perform data backup and recovery.
  3. Set up TiCDC for data replication (A->B).
  4. Upgrade cluster A in place, and if there are any issues, switch the Proxy to cluster B.

The advantage of this approach is that no changes are needed for the business, and in case of issues, switching back to the old cluster takes a short time. You can refer to this method.

| username: hey-hoho | Original post link

DM cannot migrate TiDB, it can only migrate MySQL.
If the version difference is small, directly upgrade in place using tiup. If the version difference is large, set up a new cluster to migrate data.

| username: Aaronz | Original post link

Under normal circumstances, there shouldn’t be any major issues with the upgrade. Just make sure to back up in advance. The main concern is whether the development code has any compatibility issues, which needs to be tested beforehand. For critical business operations, it’s advisable to set up a synchronized cluster in advance. You can use CDC or implement your own CDC to Kafka for bidirectional synchronization. In case of any anomalies, you can switch over promptly.

| username: TIDB-Learner | Original post link

TiUP is simple and practical.

| username: chris-zhang | Original post link

The version iteration speed is indeed fast, and the upgrade issues are also quite prominent, especially when crossing major versions (e.g., upgrading from 3.x to 6.x or 7.x). Setting up a new system feels more reliable.

| username: DBAER | Original post link

This should be the best.

| username: Kongdom | Original post link

We usually use tiup for upgrades during downtime, and for those that cannot be stopped, we can only perform online tiup upgrades. Because we don’t have that much hardware~ :yum:

| username: 像风一样的男子 | Original post link

It is recommended to use tiup for the upgrade. Just make sure to do thorough testing before the upgrade.

| username: TiDBer_RjzUpGDL | Original post link

Still tiup

| username: TiDBer_rvITcue9 | Original post link


| username: zhang_2023 | Original post link

Directly use tiup to upgrade.

| username: Daniel-W | Original post link

Make sure to back up before upgrading. For major versions, perform an offline upgrade with downtime. For minor versions, perform an online in-place upgrade.

| username: No_Fear | Original post link

All directly refer to the official documentation.

| username: TiDBer_bpfeWK9K | Original post link

The TiUP upgrade is relatively simple, provided that thorough testing and various contingency plans are in place.

| username: onlyacat | Original post link

Minor version upgrades are generally not a problem. For major version upgrades, it’s best to have a contingency plan.

| username: Hacker_QGgM2nks | Original post link

Directly upgrade in place. If the version gap is large, just roll back a few more times.

| username: TiDBer_嘎嘣脆 | Original post link

Upgrade the local offline version of tiup and back up the data.

| username: Hacker_PtIIxHC1 | Original post link

Use tiup for in-place upgrade (prepare a rollback plan, create a new version cluster, and use TiCDC to synchronize the original cluster in real-time for rollback).

| username: TiDBer_QYr0vohO | Original post link

  1. For minor versions, you can directly upgrade in place with tiup, but make sure to do backups and testing.
  2. For major versions, you can deploy a higher version of TiDB and use DM to migrate data to the higher version of TiDB.