Backing up and restoring using Doris tools (such as doris_backup)

What is Doris?

Doris is an open-source columnar database system designed to provide high-performance, easy-to-use data storage solutions.

What is doris_backup?

doris_backup is a tool for backing up and restoring the Doris database, allowing users to quickly and efficiently achieve data security and reliability.

Dependencies

  • Doris 1.9.0 or later
  • doris_backup tool (can be downloaded from official GitHub)

Using doris_backup for Backup

1. Install doris_backup: Install and configure the doris_backup tool on your system to ensure it works correctly.

2. Initialize database connection: Connect to your Doris instance using the following command: doris_backup -c /path/to/doris/config

3. Execute backup process:

doris_backup -b backup_name -p password -u username -t table_names --host localhost:8030
  • backup_name: Backup file name
  • password: Password (if needed)
  • username: Username (if needed)
  • table_names: Table names to be backed up (can use -t option)
  • --host localhost:8030: Specify the address to connect to the Doris instance

4. Check backup status:

doris_backup -v backup_name
  • -v option: Display detailed information about the backup process

Using doris_backup for Restore

1. Download backup file: Download the backup file to be restored from the backup storage location.

2. Connect to Doris instance:

doris -c /path/to/doris/config -r

3. Execute restore process:

doris_restore --drop-tables  --backup-file /path/to/backup_file.doris --host localhost:8030
  • <table_names>: Table names to be restored (can be obtained from the previous backup file)
  • --backup-file option: Specify which backup file to use for restoration
  • --drop-tables option: Whether to drop original tables (default is true)

4. Check restore results:

doris -c /path/to/doris/config --info

5. Stop Doris instance:

doris -c /path/to/doris/config --stop

Notes

  • Ensure you have sufficient permissions and that the Backup and Restore processes will not impact the system.
  • When using doris_backup, ensure your system meets the required system requirements. Before starting any operation, understand the related backup and restore processes to avoid data loss.