Back Up and Restore TiDB Cloud Dedicated Data
This document describes how to back up and restore your TiDB Cloud Dedicated cluster data on TiDB Cloud. TiDB Cloud Dedicated supports automatic backup and manual backup. You can also restore backup data to a new cluster or restore a deleted cluster from the recycle bin.
Limitations
- For clusters of v6.2.0 or later versions, TiDB Cloud Dedicated supports restoring user accounts and SQL bindings from backups by default.
- TiDB Cloud Dedicated does not support restoring system variables stored in the
mysql
schema. - It is recommended that you import data first, then perform a manual snapshot backup, and finally enable Point-in-time Restore. Because the data imported through the TiDB Cloud console does not generate change logs, it cannot be automatically detected and backed up. For more information, see Import CSV Files from Amazon S3 or GCS into TiDB Cloud.
- If you turn on and off Point-in-time Restore multiple times, you can only choose a time point within the recoverable range after the most recent Point-in-time Restore is enabled. The earlier recoverable range is not accessible.
- DO NOT modify the switches of Point-in-time Restore and Dual Region Backup at the same time.
Backup
Turn on auto backup
TiDB Cloud Dedicated supports both snapshot backup and log backup. Snapshot backup enables you to restore data to the backup point. By default, snapshot backups are taken automatically and stored according to your backup retention policy. You can disable auto backup at any time.
Turn on Point-in-time Restore
This feature supports restoring data of any point in time to a new cluster. You can use it to:
- Reduce RPO in disaster recovery.
- Resolve cases of data write errors by restoring point-in-time that is before the error event.
- Audit the historical data of the business.
It is strongly recommended to turn on this feature. The cost is the same as snapshot backup. For more information, refer to Data Backup Cost.
To turn on this feature, perform the following steps:
Navigate to the Backup page of a TiDB Cloud Dedicated cluster.
Click Backup Settings.
Toggle the Auto Backup switch to On.
Toggle the Point-in-time Restore switch to On.
Click Confirm to preview the configuration changes.
Click Confirm again to save changes.
Configure backup schedule
TiDB Cloud Dedicated supports daily and weekly backup schedules. By default, the backup schedule is set to daily. You can choose a specific time of the day or week to start snapshot backup.
To configure the backup schedule, perform the following steps:
Navigate to the Backup page of a TiDB Cloud Dedicated cluster.
Click Backup Settings.
Toggle the Auto Backup switch to On.
Configure the backup schedule as follows:
In Backup Scheduler, select either the Daily or Weekly checkbox. If you select Weekly, you need to specify the days of the week for the backup.
In Backup Time, schedule a start time for the daily or weekly cluster backup.
If you do not specify a preferred backup time, TiDB Cloud assigns a default backup time, which is 2:00 AM in the time zone of the region where the cluster is located.
In Backup Retention, configure the minimum backup data retention period. The default period is 7 days. To minimize the impact on business, it is recommended to schedule automatic backup during periods of low workloads.
Turn on dual region backup
TiDB Cloud Dedicated supports dual region backup by replicating backups from your cluster region to another different region. After you enable this feature, all backups are automatically replicated to the specified region. This provides cross-region data protection and disaster recovery capabilities. It is estimated that approximately 99% of the data can be replicated to the secondary region within an hour.
Dual region backup costs include both backup storage usage and cross-region data transfer fees. For more information, refer to Data Backup Cost.
To turn on dual region backup, perform the following steps:
Navigate to the Backup page of a TiDB Cloud Dedicated cluster.
Click Backup Settings.
Toggle the Dual Region Backup switch to On.
From the Dual Region drop-down list, select a region to store the backup files.
Click Confirm to preview the configuration changes.
Click Confirm again to save changes.
Turn off auto backup
To turn off auto backup, perform the following steps:
Navigate to the Backup page of a TiDB Cloud Dedicated cluster.
Click Backup Settings.
Toggle the Auto Backup switch to Off.
Click Confirm to preview the configuration changes.
Click Confirm again to save changes.
Turn off dual region backup
To turn off dual region backup, perform the following steps:
Navigate to the Backup page of a TiDB Cloud Dedicated cluster.
Click Backup Settings.
Toggle the Dual Region Backup switch to Off.
Click Confirm to preview the configuration changes.
Click Confirm again to save changes.
Perform a manual backup
Manual backups are user-initiated backups that enable you to back up your data to a known state as needed, and then restore to that state at any time.
To apply a manual backup to your TiDB Cloud Dedicated cluster, perform the following steps:
Navigate to the Backup tab of a cluster.
Click Manual Backup. The setting window displays.
Enter a Name.
Click Confirm. Then your cluster data is backed up.
Delete backups
Delete backup files
To delete an existing backup file, perform the following steps:
Navigate to the Backup tab of a cluster.
Click Delete for the backup file that you want to delete.
Delete a running backup job
To delete a running backup job, it is similar as Delete backup files.
Navigate to the Backup tab of a cluster.
Click Delete for the backup file that is in the Pending or Running state.
Restore
Restore data to a new cluster
To restore your TiDB Cloud Dedicated cluster data from a backup to a new cluster, take the following steps:
Navigate to the Backup tab of a cluster.
Click Restore. The setting window displays.
In Restore Mode, choose Restore From Region, indicating the region of backup stores.
In Restore Mode, choose to restore data of any point in time or a selected backup to a new cluster.
- Select Time Point
- Select Backup Name
To restore data of any point in time within the backup retention to a new cluster, make sure that Point-in-time Restore in Backup Settings is on and then take the following steps:
- Click Select Time Point.
- Select Date and Time you want to restore to.
To restore a selected backup to the new cluster, take the following steps:
- Click Select Backup Name.
- Select a backup you want to restore to.
In Restore to Region, select the same region as the Backup Storage Region configured in the Backup Settings.
In the Restore window, you can also make the following changes if necessary:
- Set the cluster name.
- Update the port number of the cluster.
- Increase node number, vCPU and RAM, and storage for the cluster.
Click Restore.
The cluster restore process starts and the Password Settings dialog box is displayed.
In the Password Settings dialog box, set the root password to connect to your cluster, and then click Save.
Restore a deleted cluster
To restore a deleted cluster from recycle bin, take the following steps:
Log in to the TiDB Cloud console.
Click in the lower-left corner, switch to the target project if you have multiple projects, and then click Project Settings.
On the Project Settings page of your project, click Recycle Bin in the left navigation pane, locate the cluster you want to restore, and then click Backups in the Action column.
Locate your desired backup time, and then click Restore in the Action column.
In the Restore window, make the following changes if necessary:
- Update the port number of the cluster.
- Increase the node number, vCPU and RAM, and storage for the cluster.
Click Confirm.
The cluster restore process starts and the Password Settings dialog box is displayed.
In the Password Settings dialog box, set the root password to connect to your cluster, and then click Save.