📣
TiDB Cloud Premium is now in public preview. Unlimited growth, instant elasticity, advanced security for enterprise workloads. Try it out →

Back Up and Restore TiDB Cloud Premium Data



This document describes how to back up and restore your data on TiDB Cloud Premium instances. TiDB Cloud Premium supports both automatic backups and manual backups, and lets you restore backup data to a new instance as needed.

Backup files can originate from the following sources:

  • Active TiDB Cloud Premium instances
  • The Recycle Bin for backups from deleted TiDB Cloud Premium instances

View the Backup page

  1. On the My TiDB page, click the name of your target TiDB Cloud Premium instance to go to its overview page.

  2. In the left navigation pane, click Data > Backup.

Automatic backups

TiDB Cloud Premium provides enhanced automatic backup capabilities for production environments. It combines high-frequency snapshots with log backups to ensure data reliability.

Automatic backup policies

TiDB Cloud Premium instances use a multi-layer backup architecture to protect your data, as described in the following table:

Backup typeRetention periodRestore granularity
Point-in-time recovery (PITR)7 daysRestore to any specific point in time within the 7-day window.
Hourly snapshot7 daysRestore from any hourly snapshot generated within the last 7 days.
Daily snapshot33 daysRestore from any daily snapshot generated within the last 33 days. By default, daily snapshots are captured at 00:00 UTC.

Backup execution rules

  • Backup cycle: TiDB Cloud Premium instances perform both hourly and daily automatic backups.

  • Backup schedule:

    • Hourly backups run at the start of every hour.
    • Daily backups run at 00:00 UTC each day.
    • Currently, you cannot customize or manage backup schedules.
  • Retention behavior: backups expire automatically when they exceed their retention period (7 days or 33 days) and cannot be restored.

Delete backup files

To delete an existing backup file for your TiDB Cloud Premium instance, perform the following steps:

  1. Navigate to the Backup page of your instance.

  2. Locate the corresponding backup file you want to delete, and click ... > Delete in the Action column.

Manual backups

In addition to automatic backups, TiDB Cloud Premium supports manual backups. A manual backup provides a controlled, guaranteed restore point. It is highly recommended that you create a manual backup before you perform high-risk operations such as system upgrades, critical data deletion, or irreversible schema or configuration changes.

Key characteristics

  • Retention and deletion: unlike automatic backups, manual backups are not automatically deleted based on retention policies. They are retained until you explicitly delete them. If you delete the instance, its manual backups move to the recycle bin and remain there until you manually delete them.

  • Storage location: manual backups are stored in cloud storage managed by TiDB.

  • Cost: because manual backups are retained long term and incur additional charges.

  • Limitations: manual backups do not support point-in-time recovery (PITR) or partial backups (for example, table-level or database-level backups). You cannot restore a manual backup to an existing instance. Each restore operation creates a new instance.

  • Permissions: both Organization Owner and Instance Manager can create manual backups. Only Organization Owner can restore system-managed manual backups.

Create a manual backup

  1. Navigate to the Backup page of your instance.

  2. In the upper-right corner, click ..., and then click Manual Backup.

  3. Confirm the operation. The backup is stored in TiDB Cloud and will appear in the Backup List.

You can restore a manual backup directly in the TiDB Cloud console without providing external storage credentials.

Restore

TiDB Cloud provides restore functionality to help recover data in case of accidental loss or corruption. You can restore from backups of active instances or from deleted instances in the Recycle Bin.

Restore mode

TiDB Cloud supports snapshot restore and point-in-time restore for your instance.

  • Snapshot Restore: restores your instance from a specific backup snapshot. You can use this method to restore both automatic and manual backups. In the Backup List, manual backups are labeled with the Manual type and a Permanent expiration status.

  • Point-in-Time Restore: restores your instance to a specific point in time.

    • Premium instances: can be restored to any time within the last 7 days, but not earlier than the instance creation time or later than one minute before the current time. Note that PITR is not supported for manual backups.

Restore destination

TiDB Cloud supports restoring data to a new instance.

Restore to a new TiDB Cloud Premium instance

To restore your data to a new TiDB Cloud Premium instance, take the following steps:

  1. Navigate to the Backup page of your instance.

  2. Click Restore.

  3. On the Select Backup page, choose the Restore Mode you want to use. You can restore from a specific backup snapshot or restore to a specific point in time.

      To restore from a selected backup snapshot, take the following steps:

      1. Click Snapshot Restore.
      2. Select the backup snapshot you want to restore from.

      To restore to a specific point in time for a Premium instance, take the following steps:

      1. Click Point-in-Time Restore.
      2. Select the date and time you want to restore to.
    • Click Next to proceed to the Restore to a New Instance page.

    • Configure your new TiDB Cloud Premium instance for restoration. The steps are the same as creating a TiDB Cloud Premium instance.

    • Click Restore to start the restore process.

      When the restore process starts, the instance status first changes to Creating. After the creation is complete, it changes to Restoring. The instance remains unavailable until the restore finishes and the status changes to Available.

    Restore from Recycle Bin

    To restore a deleted TiDB Cloud Premium instance from the Recycle Bin, take the following steps:

    1. In the TiDB Cloud console, navigate to the My TiDB page of your organization, click ... in the upper-right corner, and then click Recycle Bin.

    2. On the Recycle Bin page, click the Premium tab to go to the recycle bin of TiDB Cloud Premium instances.

    3. Locate the TiDB Cloud Premium instance you want to restore, and then click the > button to expand the available backups of the instance.

    4. In the row of your desired backup, click ..., and then select Restore.

    5. On the Restore page, follow the same steps as Restore to a new instance to restore the backup to a new instance.

    Restore backups from a different plan type

    Currently, you can only restore backups from a TiDB Cloud Dedicated cluster hosted on AWS to a new TiDB Cloud Premium instance.

    To restore a backup generated by a TiDB Cloud Dedicated cluster, follow these steps:

    1. Log in to the TiDB Cloud console, and then navigate to the My TiDB page. In the upper-right corner, click ..., and then click Restore from Another Plan.

    2. On the Select Backup page, select the project that contains the target TiDB Cloud Dedicated cluster. Select the TiDB Cloud Dedicated cluster, select the backup snapshot that you want to restore, and then click Next.

    3. On the Restore page, follow the same steps as Restore to a new instance to restore the backup to a new instance.

    Restore backups from cloud storage

    TiDB Cloud Premium supports restoring backups from cloud storage (such as Amazon S3 and Alibaba Cloud Object Storage Service (OSS)) to a new instance. This feature is compatible with backups generated from TiDB Cloud Dedicated clusters or TiDB Self-Managed clusters.

    Steps

    Before you begin, ensure that you have an access key and secret key with sufficient permissions to access the backup files.

    To restore backups from cloud storage, do the following:

    1. Log in to the TiDB Cloud console, and then navigate to the My TiDB page. In the upper-right corner, click ... , and then click Restore from Cloud Storage.

    2. On the Select Backup Storage Location page, provide the following information:

      • Cloud Provider: select the cloud provider where your backup files are stored.
      • Region: if your cloud provider is Alibaba Cloud OSS, select a region.
      • Backup Files URI: enter the URI of the top-level folder that contains your backup files.
      • Access Key ID: enter your access key ID.
      • Access Key Secret: enter your access key secret.
    3. Click Verify Backup and Next.

    4. If the verification is successful, the Restore to a New Instance page appears. Review the backup information displayed at the top of the page, and then follow the steps in Create a TiDB Cloud Premium Instance to restore the backup to a new instance.

      If the backup information is incorrect, click Previous to return to the previous page, and then enter the correct information.

    5. Click Restore to restore the backup.

    References

    This section describes how to configure access for Amazon S3 and Alibaba Cloud OSS.

    Configure Amazon S3 access using an AWS access key

    It is recommended that you use an IAM user, rather than the AWS account root user, to create an access key.

    Take the following steps to configure an access key:

    1. Create an IAM user and access key.

      1. Create an IAM user. For more information, see Create an IAM user in your AWS account.
      2. Sign in to the IAM console using your AWS account ID or account alias, and your IAM user name and password.
      3. Create an access key. For more information, see Manage access keys for IAM users.
    2. Grant permissions to the IAM user.

      Create a policy with only the permissions required for your task and attach it to the IAM user. To restore data to a TiDB Cloud Premium instance, grant the s3:GetObject, s3:GetBucketLocation, and s3:ListBucket permissions.

      The following is an example policy that allows TiDB Cloud to restore data from a specific folder in your Amazon S3 bucket.

      { "Version": "2012-10-17", "Statement": [ { "Sid": "AllowGetBucketLocation", "Effect": "Allow", "Action": "s3:GetBucketLocation", "Resource": "arn:aws:s3:::<Your S3 bucket name>" }, { "Sid": "AllowListPrefix", "Effect": "Allow", "Action": "s3:ListBucket", "Resource": "arn:aws:s3:::<Your S3 bucket name>", "Condition": { "StringLike": { "s3:prefix": "<Your backup folder>/*" } } }, { "Sid": "AllowReadObjectsInPrefix", "Effect": "Allow", "Action": "s3:GetObject", "Resource": "arn:aws:s3:::<Your S3 bucket name>/<Your backup folder>/*" } ] }

      In the preceding policy, replace <Your S3 bucket name> and <Your backup folder> with your actual bucket name and backup directory. This configuration follows the principle of least privilege by limiting access to only the necessary backup files.

    Configure Alibaba Cloud OSS access

    To grant TiDB Cloud access to your Alibaba Cloud OSS bucket, you need to create an AccessKey pair for the bucket.

    Take the following steps to configure an AccessKey pair:

    1. Create a RAM user and obtain the AccessKey pair. For more information, see Create a RAM user.

      In the Access Mode section, select Using permanent AccessKey to access.

    2. Create a custom policy with the required permissions. For more information, see Create custom policies.

      • In the Effect section, select Allow.

      • In the Service section, select Object Storage Service.

      • In the Action section, select the required permissions. To restore a backup to a TiDB Cloud Premium instance, grant the oss:ListObjects and oss:GetObject permissions.

        The following JSON example shows a policy for a restore task. This policy restricts access to a specific bucket and backup folder.

        { "Version": "1", "Statement": [ { "Effect": "Allow", "Action": "oss:ListObjects", "Resource": "acs:oss:*:*:<Your bucket name>", "Condition": { "StringLike": { "oss:Prefix": "<Your backup folder>/*" } } }, { "Effect": "Allow", "Action": "oss:GetObject", "Resource": "acs:oss:*:*:<Your bucket name>/<Your backup folder>/*" } ] }
      • In the Resource section, select the bucket and the specific objects in the bucket.

    3. Attach the custom policies to the RAM user.

      For more information, see Grant permissions to a RAM user.

    Was this page helpful?