title | summary | aliases | |
---|---|---|---|
Back Up and Restore TiDB Cloud Dedicated Data |
Learn how to back up and restore your TiDB Cloud Dedicated cluster. |
|
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.
Tip
To learn how to back up and restore TiDB Cloud Serverless cluster data, see Back Up and Restore TiDB Cloud Serverless Data.
- 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.
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.
Note
The Point-in-time Restore feature is supported for TiDB Cloud Dedicated clusters that are v6.4.0 or later.
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.
Warning
Point-in-Time Restore only takes effect after the next backup task is completed. To make it take effect earlier, you can manually perform a backup after enabling it.
-
Click Confirm to preview the configuration changes.
-
Click Confirm again to save changes.
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.
Warning
- When weekly backup is enabled, the Point-in-time Restore feature is enabled by default and cannot be disabled.
- If you change the backup scheduler from weekly to daily, the Point-in-time Restore feature remains its original setting. You can manually disable it if needed.
-
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.
Note
- Backup jobs are automatically delayed when data import jobs are in progress. DO NOT run manual backups during data import or cluster scaling.
-
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.
Note
- After you delete a cluster, the automatic backup files will be retained for a specified period, as set in backup retention. You need to delete the backup files accordingly.
- After you delete a cluster, the existing manual backup files will be retained until you manually delete them, or your account is closed.
-
Note:
TiDB Cloud Dedicated clusters hosted on Google Cloud work seamlessly with Google Cloud Storage. Similar to Google Cloud Storage, TiDB Cloud Dedicated supports dual-region pairing only within the same multi-region code as Google dual-region storage. For example, in Asia, currently you must pair Tokyo and Osaka together for dual-region storage. For more information, refer to Dual-regions.
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.
Note
Turning off auto backup will also turn off point-in-time restore by default.
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.
Tip
Disabling dual region backup does not immediately delete the backups in the secondary region. These backups will be cleaned up later according to the backup retention schedule. To remove them immediately, you can manually delete the backups.
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.
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.
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.
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.
Note
When you restore a TiDB cluster from backups, the restore process retains the original time zone setting without overwriting it.
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.
Note
- The default value of the Restore From Region is the same as the backup cluster.
-
In Restore Mode, choose to restore data of any point in time or a selected backup to a new cluster.
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.
Note:
You cannot restore a deleted cluster to any point in time. You can only select an automatic or manual backup to restore.
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.