StarRocks Backup and Restore automation tool
Project description
StarRocks Backup & Restore
Full and incremental backup automation for StarRocks shared-nothing clusters.
Requirements: StarRocks 3.5+ (shared-nothing mode)
Documentation
- Why This Tool? (this page)
- Installation (this page)
- Configuration (this page)
- Basic Usage (this page)
- How It Works (this page)
- Getting Started - Step-by-step tutorial
- Core Concepts - Understand inventory groups, backup types, and restore chains
- Installation Guide - All installation methods
- Configuration Reference - Config file reference and TLS setup
- Commands Reference - Detailed command reference
- Scheduling & Monitoring - Automate backups and monitor status
Why This Tool?
StarRocks provides native BACKUP and RESTORE commands, but they only support full backups. For large-scale deployments hosting data at petabyte scale, full backups are not feasible due to time, storage, and network constraints.
This tool adds incremental backup capabilities to StarRocks by leveraging native partition-based backup features.
What StarRocks doesn't provide:
- ❌ No incremental backups - You must manually identify changed partitions and build complex backup commands
- ❌ No backup history - No built-in way to track what was backed up, when, or which backups succeeded/failed
- ❌ No restore intelligence - You manually determine which backups are needed for point-in-time recovery
- ❌ No organization - No way to group tables or manage different backup strategies
- ❌ No concurrency control - Multiple backup operations can conflict
What this tool provides:
- ✅ Automatic incremental backups - Tool detects changed partitions since the last full backup automatically
- ✅ Complete operation tracking - Every backup and restore is logged with status, timestamps, and error details
- ✅ Intelligent restore - Automatically resolves backup chains (full + incremental) for you
- ✅ Inventory groups - Organize tables into groups with different backup strategies
- ✅ Job concurrency control - Prevents conflicting operations
- ✅ Safe restores - Atomic rename mechanism prevents data loss during restore
- ✅ Metadata management - Dedicated
opsdatabase tracks all backup metadata and partition manifests
In short: this tool transforms StarRocks's basic backup/restore commands into a production-ready incremental backup solution.
Installation
Option 1: PyPI
python3 -m venv .venv
source .venv/bin/activate
pip install starrocks-br
Option 2: Standalone Executable
Download from releases:
# Linux
chmod +x starrocks-br-linux-x86_64
mv starrocks-br-linux-x86_64 starrocks-br
./starrocks-br --help
See Installation Guide for all options.
Configuration
Create a config.yaml file pointing to your StarRocks cluster:
host: "127.0.0.1" # StarRocks FE node address
port: 9030 # MySQL protocol port
user: "root" # Database user with backup/restore privileges
database: "your_database" # Database containing tables to backup
repository: "your_repo_name" # Repository created via CREATE REPOSITORY in StarRocks
# Optional: Define table inventory groups directly in config
table_inventory:
- group: "production"
tables:
- database: "mydb"
table: "users"
- database: "mydb"
table: "orders"
Set password:
export STARROCKS_PASSWORD="your_password"
See Configuration Reference for TLS and advanced options.
Basic Usage
Initialize:
starrocks-br init --config config.yaml
This creates the ops database and automatically populates table inventory from your config (if defined).
Note: If you modify the table_inventory in your config file, rerun starrocks-br init --config config.yaml to update the database.
Alternative: Define inventory groups manually (in StarRocks):
INSERT INTO ops.table_inventory (inventory_group, database_name, table_name)
VALUES
('production', 'mydb', 'users'),
('production', 'mydb', 'orders');
Backup:
# Full backup
starrocks-br backup full --config config.yaml --group production
# Incremental backup (tool detects changed partitions automatically)
starrocks-br backup incremental --config config.yaml --group production
Restore:
# Tool automatically resolves backup chains
starrocks-br restore --config config.yaml --target-label mydb_20251118_full
See Commands Reference for all options.
How It Works
- Inventory Groups: Define collections of tables that share the same backup strategy
- ops Database: Tool creates an
opsdatabase to track all operations and metadata - Automatic Incrementals: Tool queries partition metadata and compares with the baseline to detect changes
- Intelligent Restore: Automatically resolves backup chains (full + incremental) for point-in-time recovery
- Safe Operations: All restores use temporary tables with atomic rename for safety
Read Core Concepts for detailed explanations.
Contributing
We welcome contributions! See issues for areas that need help or create a new issue to report a bug or request a feature.
License
This project is licensed under the Apache License 2.0 - see the LICENSE file for details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file starrocks_br-0.6.0.tar.gz.
File metadata
- Download URL: starrocks_br-0.6.0.tar.gz
- Upload date:
- Size: 75.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
191257ff35841ed6ab7e7745418ca12749fbd9bb93effac58771aec60d909d47
|
|
| MD5 |
8a8a8509af2ea1b8360f588f827eb3ba
|
|
| BLAKE2b-256 |
89fcf19e98a1c68d408333e15d0f3a13f4f468efc22e22994a48b36312661500
|
Provenance
The following attestation bundles were made for starrocks_br-0.6.0.tar.gz:
Publisher:
build-executables.yml on deep-bi/starrocks-backup-and-restore
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
starrocks_br-0.6.0.tar.gz -
Subject digest:
191257ff35841ed6ab7e7745418ca12749fbd9bb93effac58771aec60d909d47 - Sigstore transparency entry: 910765852
- Sigstore integration time:
-
Permalink:
deep-bi/starrocks-backup-and-restore@a090e3b2403f939e182c9073f5ed90da4a2e9b3e -
Branch / Tag:
refs/tags/v0.6.0 - Owner: https://github.com/deep-bi
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
build-executables.yml@a090e3b2403f939e182c9073f5ed90da4a2e9b3e -
Trigger Event:
push
-
Statement type:
File details
Details for the file starrocks_br-0.6.0-py3-none-any.whl.
File metadata
- Download URL: starrocks_br-0.6.0-py3-none-any.whl
- Upload date:
- Size: 49.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
df2e145a1b6d36a5f632e85beea7637d044fce846625b77d45468cad956586bc
|
|
| MD5 |
58173c4898a96df51b4a0cf8d2683101
|
|
| BLAKE2b-256 |
90aa43bd55e10339a11b45d14671e60c6038563d610fe6dcb0d38b7c2d90f7af
|
Provenance
The following attestation bundles were made for starrocks_br-0.6.0-py3-none-any.whl:
Publisher:
build-executables.yml on deep-bi/starrocks-backup-and-restore
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
starrocks_br-0.6.0-py3-none-any.whl -
Subject digest:
df2e145a1b6d36a5f632e85beea7637d044fce846625b77d45468cad956586bc - Sigstore transparency entry: 910765854
- Sigstore integration time:
-
Permalink:
deep-bi/starrocks-backup-and-restore@a090e3b2403f939e182c9073f5ed90da4a2e9b3e -
Branch / Tag:
refs/tags/v0.6.0 - Owner: https://github.com/deep-bi
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
build-executables.yml@a090e3b2403f939e182c9073f5ed90da4a2e9b3e -
Trigger Event:
push
-
Statement type: