docs/en/08-operation/09-backup.md
You can back up the data in your TDengine cluster and restore it in the event that data is lost or damaged.
taosdump is an open-source tool that supports backing up data from a running TDengine cluster and restoring the backed-up data to the same or another running TDengine cluster. taosdump can back up the database as a logical data unit or back up data records within a specified time period in the database. When using taosdump, you can specify the directory path for data backup. If no directory path is specified, taosdump will default to backing up the data in the current directory.
Below is an example of using taosdump to perform data backup.
taosdump -h localhost -P 6030 -D dbname -o /file/path
After executing the above command, taosdump will connect to the TDengine cluster at localhost:6030, query all data in the database dbname, and back up the data to /file/path.
When using taosdump, if the specified storage path already contains data files, taosdump will prompt the user and exit immediately to avoid data overwriting. This means the same storage path can only be used for one backup. If you see related prompts, please operate carefully to avoid accidental data loss.
To restore data files from a specified local file path to a running TDengine cluster, you can execute the taosdump command by specifying command-line parameters and the data file path. Below is an example code for taosdump performing data restoration.
taosdump -i /file/path -h localhost -P 6030
After executing the above command, taosdump will connect to the TDengine cluster at localhost:6030 and restore the data files from /file/path to the TDengine cluster.
TDengine Enterprise implements incremental backup and recovery of data by using data subscription. The backup and recovery functions of TDengine Enterprise include the following concepts:
WAL_RETENTION_PERIOD for the specified database.current time - backup_retention_period must be uploaded to S3.backup_retention_size backup files are kept locally.You can view your backup plans and modify, clone, or delete them using the buttons in the Operation columns. Click Refresh to update the status of your plans. Note that you must stop a backup plan before you can delete it. You can also click View in the Backup File column to view the backup record points and files created by each plan.
A port access exception is indicated by the following error:
Error: tmq to td task exec error
Caused by:
[0x000B] Unable to establish connection
If you encounter this error, check whether the data source FQDN is connected and whether port 6030 is listening and accessible.
A connection issue is indicated by the task failing to start and reporting the following error:
Error: tmq to td task exec error
Caused by:
0: WebSocket internal error: IO error: failed to lookup address information: Temporary failure in name resolution
1: IO error: failed to lookup address information: Temporary failure in name resolution
2: failed to lookup address information: Temporary failure in name resolution
The following are some possible errors for WebSocket connections:
A WAL configuration issue is indicated by the task failing to start and reporting the following error:
Error: tmq to td task exec error
Caused by:
[0x038C] WAL retention period is zero
To resolve this error, modify the WAL retention period for the affected database:
ALTER DATABASE test WAL_RETENTION_PERIOD 3600;