## Module 4: Backing up and Restoring a TiDB Cloud Dedicated Cluster

In this module, we look at how to back up and restore a TiDB Cloud Dedicated.

### Step 1. Open the backup panel

+ Expand the `Data` pane, and click `Backup`.

  ![80%](https://lab-static.pingcap.com/images/2025/7/24/687dfb88198979dfe5040c3c45d658782cbf79cd.png)

+ Click `Backup Settings` on the upper-right corner.

### Step 2. Check `Auto Backup` options

+ On this page, you can configure `Auto Backup`

  ![80%](https://lab-static.pingcap.com/images/2025/7/24/b46f12a809000bbcd1ebcc53ce4d1b09bddf0588.png)

### Step 3. Conduct manual backup

+ On the `Backup` page, click `Manual Backup`.

  ![80%](https://lab-static.pingcap.com/images/2025/7/31/0ad36bb503635304557dec3719fa13e86ce73cd6.png)

+ Enter `BikeshareHistory` as the `Name`, and then click `Confirm`.

  ![80%](https://lab-static.pingcap.com/images/2025/7/25/5bd531088fee9627486bd7a0ff05454db5e04cb2.png)

+ The backup should be ready in 10 to 20 minutes.

  ![80%](https://lab-static.pingcap.com/images/2025/7/24/c7f35be2cc829b16389b733af02975048dcd9c56.png)

### Step 4. Restore the backup

+ Click `...`.

  ![80%](https://lab-static.pingcap.com/images/2025/7/24/a4c3c015fea2a53e922c10ce519667472fe3f804.png)

+ Configure the cluster for restore, and click `Restore`.

![80%](https://lab-static.pingcap.com/images/2025/7/24/cb5b1874788daead9f428dd8681cd243de6e82ce.png)

> [!TIP]
> The configuration of the restored cluster can be difference from the old cluster.
> For example, you can spin up more or less nodes. You may also change the disk size.

### Step 5. Connect to `Cluster-Restore`

+ Click `Connect` on the upper-right corner to open the connection panel.
+ Choose `Public` as the `Connection Type`.
+ Then, click `Configure IP Access List`.
+ Choose `Allow access from anywhere`.
+ Then, Click `Comfirm`.
+ Open [Terminal 2](ssh://monitor1-ssh#2)
+ Use the connect command to connect to `Cluster-Restore`.

  ```bash
  mysql --comments -u 'root' -h <host_url> -P 4000 -D 'test' --ssl-mode=VERIFY_IDENTITY --ssl-ca=/home/ubuntu/ca.pem -p'<PASSWORD>'
  ```

  ```output
  ...
  Your MySQL connection id is 227
  Server version: 8.0.11-TiDB-v8.5.2 TiDB Server (Apache License 2.0) Enterprise Edition, MySQL 8.0 compatible

  Copyright (c) 2000, 2025, Oracle and/or its affiliates.

  Oracle is a registered trademark of Oracle Corporation and/or its
  affiliates. Other names may be trademarks of their respective owners.
  ...
  ```

### Step 6. Check the restored data

  ```sql
  USE bikeshare;
  SELECT ride_id, rideable_type, started_at, ended_at FROM `trips` WHERE start_station_name='12th & U St NW' limit 3;
  ```

  ```output
  MySQL [bikeshare]> SELECT ride_id, rideable_type, started_at, ended_at FROM `trips` WHERE start_station_name='12th & U St NW' limit 3;
  +------------------+---------------+---------------------+---------------------+
  | ride_id          | rideable_type | started_at          | ended_at            |
  +------------------+---------------+---------------------+---------------------+
  | 000B23FFC23B5FC8 | classic_bike  | 2020-12-22 12:33:12 | 2020-12-22 12:41:59 |
  | 0023EE3F7FA273AA | docked_bike   | 2020-12-31 11:02:14 | 2020-12-31 12:21:51 |
  | 0025068889EA0F45 | docked_bike   | 2020-11-19 14:45:34 | 2020-11-19 14:51:37 |
  +------------------+---------------+---------------------+---------------------+
  3 rows in set (0.004 sec)
  ```

  ```sql
  exit
  ```

### Step 7. Delete the `Cluster-Restore`

+ Go to `Overview`, click `...`, and then delete your cluster.

  ![80%](https://lab-static.pingcap.com/images/2025/7/24/a319028d778d0e722f741644e79f7e9d655ad37b.png)
