tencent cloud

TDSQL-C for MySQL

Restoring Data via Linux

Download
Focus Mode
Font Size
Last updated: 2026-07-31 10:27:27
AI-Translated
This document describes how to restore data using logical backup files.

Scenarios

Note:
To save storage space, backup files in TDSQL-C for MySQL are first compressed using qpress and then packaged using xbstream (xbstream is a packaging/unpackaging tool from Percona).
If your cluster storage usage exceeds 2 TB, it is not recommended to use logical backup, as this may lead to backup failure.
TDSQL-C for MySQL supports logical backup. You can use the console to perform a manual backup to generate logical backup files and download them for the entire cluster or specific databases/tables. This document describes how to restore data using logical backup files on a Linux platform.

Operation Steps

Step 1: Downloading Backup Files

1. Log in to the TDSQL-C for MySQL console and perform the corresponding operations based on the actual console view mode.
Tab View
List View
Click the target cluster in the cluster list on the left to go to the cluster management page.
Find the target cluster in the cluster list on the left, and click Cluster ID or Operation column's Manage option to enter the cluster management page.

2. On the cluster management page, choose Backup Management > Data Backup List, locate the backup you need to download, and click Download in the Operation column.

3. In the pop-up dialog box, copy the download address, log in to the CVM (Linux system), and use the wget command for high-speed download.
Note:
After copying the download address, log in to the CVM (Linux system) and use the wget command to download the file.
If the cluster and the CVM are in the same region, you can use the wget command for high-speed download over the private network, regardless of whether they are in the same VPC or across different VPCs.
If the cluster and the CVM are in different regions, high-speed download over the private network is not supported. The CVM must have a public IP address enabled to support downloading using the wget command.
You can also choose to download directly via Local Download, but this method takes more time.
The wget command format is as follows:
wget -c "<backup_file_download_address>" -O <custom_name>.xb


Step 2: Unpacking Backup Files

Use xbstream to unpack the backup file.
Note:
For the xbstream tool download address, see the Percona XtraBackup official website. Select Percona XtraBackup version 2.4.6 or later. For installation instructions, see Percona XtraBackup 2.4.
xbstream -x < test0.xb -P
Note:
Replace test0.xb with your backup file name.
The unpacking result is shown in the following figure:



Step 3: Extracting Backup Files

1. Download the qpress tool using the following command.
wget -d --user-agent="Mozilla/5.0 (Windows NT x.y; rv:10.0) Gecko/20100101 Firefox/10.0" https://docs-tencentdb-1256569818.cos.ap-guangzhou.myqcloud.com/qpress-11-linux-x64.tar
Note:
If an error is reported during the wget download, you can click Download qpress tool to download it locally. Then, upload the qpress tool to the Linux CVM. For details, see Uploading Files to a Linux CVM via SCP.
2. Extract the qpress binary file using the following command.
tar -xf qpress-11-linux-x64.tar -C /usr/local/bin
source /etc/profile
3. Use qpress to decompress the backup file.
qpress -d <Backup file> <Decompression file>
<Backup file>: Replace it with the name of the corresponding unpacked backup file. Remove the angle brackets <> and keep only the actual parameter.
<Decompression file>: Specify a custom name for the decompressed file, which should follow the unpacked backup file name. Remove the angle brackets <> from the command.

Step 4: Importing Backups to the Target Database

Run the following command to import the sql file into the target database:
mysql -u<Username> -P<Port> -h<Target database private network address> -p < <sql file actually decompressed by qpress>

Related APIs

API
Description
This interface (DescribeBackupDownloadUrl) is used to query the download URL of cluster backup files.
This API (DescribeBinlogDownloadUrl) is used to query the download URL of binlog files.

Help and Support

Was this page helpful?

Help us improve! Rate your documentation experience in 5 mins.

Feedback