@@ -8,10 +8,10 @@ This CLI tool replaces the legacy Bash-based backup/restore scripts with a singl
88
99** Current Support:**
1010- Elasticsearch snapshots and restores
11+ - ClickHouse backups and restores
1112- Stackgraph backups and restores
1213- VictoriaMetrics backups and restores
13-
14- ** Planned:** ClickHouse, Configuration backups
14+ - Settings backups and restores
1515
1616## Installation
1717
@@ -69,26 +69,43 @@ List Elasticsearch indices.
6969sts-backup elasticsearch list-indices --namespace < namespace>
7070```
7171
72- #### list-snapshots
72+ #### list
7373
7474List available Elasticsearch snapshots.
7575
7676``` bash
77- sts-backup elasticsearch list-snapshots --namespace < namespace>
77+ sts-backup elasticsearch list --namespace < namespace>
7878```
7979
80- #### restore-snapshot
80+ #### restore
8181
8282Restore Elasticsearch snapshot. Automatically scales down affected deployments before restore and scales them back up afterward.
8383
8484``` bash
85- sts-backup elasticsearch restore-snapshot --namespace < namespace> --snapshot-name < name> [flags]
85+ sts-backup elasticsearch restore --namespace < namespace> [--snapshot < name> | --latest] [flags]
86+ ```
87+
88+ ** Flags:**
89+ - ` --snapshot, -s ` - Name of snapshot to restore (mutually exclusive with --latest)
90+ - ` --latest ` - Restore from the most recent snapshot (mutually exclusive with --snapshot)
91+ - ` --background ` - Run restore in background without waiting for completion
92+ - ` --yes, -y ` - Skip confirmation prompt
93+
94+ ** Note** : Either ` --snapshot ` or ` --latest ` must be specified (mutually exclusive).
95+
96+ #### check-and-finalize
97+
98+ Check the status of a restore operation and finalize if complete.
99+
100+ ``` bash
101+ sts-backup elasticsearch check-and-finalize --namespace < namespace> --operation-id < snapshot> [--wait]
86102```
87103
88104** Flags:**
89- - ` --snapshot-name, -s ` - Name of snapshot to restore (required)
90- - ` --drop-all-indices, -r ` - Delete all existing STS indices before restore
91- - ` --yes ` - Skip confirmation prompt
105+ - ` --operation-id ` - Operation ID of the restore operation (snapshot name) (required)
106+ - ` --wait ` - Wait for restore to complete if still running
107+
108+ ** Use Case** : This command is useful when a restore was started with ` --background ` flag or was interrupted (Ctrl+C).
92109
93110### stackgraph
94111
@@ -183,6 +200,90 @@ sts-backup victoriametrics check-and-finalize --namespace <namespace> --job <job
183200** Use Case** : This command is useful when a restore job was started with ` --background ` flag or was interrupted (
184201Ctrl+C).
185202
203+ ### settings
204+
205+ Manage Settings backups and restores.
206+
207+ #### list
208+
209+ List available Settings backups from S3/Minio.
210+
211+ ``` bash
212+ sts-backup settings list --namespace < namespace>
213+ ```
214+
215+ #### restore
216+
217+ Restore Settings from a backup archive. Automatically scales down affected deployments before restore and scales them
218+ back up afterward.
219+
220+ ``` bash
221+ sts-backup settings restore --namespace < namespace> [--archive < name> | --latest] [flags]
222+ ```
223+
224+ ** Flags:**
225+
226+ - ` --archive ` - Specific archive name to restore (e.g., sts-backup-20251117-1404.sty)
227+ - ` --latest ` - Restore from the most recent backup
228+ - ` --background ` - Run restore job in background without waiting for completion
229+ - ` --yes, -y ` - Skip confirmation prompt
230+
231+ ** Note** : Either ` --archive ` or ` --latest ` must be specified (mutually exclusive).
232+
233+ #### check-and-finalize
234+
235+ Check the status of a background Settings restore job and clean up resources.
236+
237+ ``` bash
238+ sts-backup settings check-and-finalize --namespace < namespace> --job < job-name> [--wait]
239+ ```
240+
241+ ** Flags:**
242+
243+ - ` --job, -j ` - Settings restore job name (required)
244+ - ` --wait, -w ` - Wait for job to complete before cleanup
245+
246+ ** Use Case** : This command is useful when a restore job was started with ` --background ` flag or was interrupted (
247+ Ctrl+C).
248+
249+ ### clickhouse
250+
251+ Manage ClickHouse backups and restores.
252+
253+ #### list
254+
255+ List available ClickHouse backups from the backup API.
256+
257+ ``` bash
258+ sts-backup clickhouse list --namespace < namespace>
259+ ```
260+
261+ #### restore
262+
263+ Restore ClickHouse from a backup. Automatically scales down affected StatefulSets before restore and scales them back up afterward.
264+
265+ ``` bash
266+ sts-backup clickhouse restore --namespace < namespace> --backup-name < name> [flags]
267+ ```
268+
269+ ** Flags:**
270+ - ` --backup-name ` - Name of the backup to restore (required)
271+ - ` --wait ` - Wait for restore to complete (default: true)
272+
273+ #### check-and-finalize
274+
275+ Check the status of a ClickHouse restore operation and finalize if complete.
276+
277+ ``` bash
278+ sts-backup clickhouse check-and-finalize --namespace < namespace> --operation-id < id> [--wait]
279+ ```
280+
281+ ** Flags:**
282+ - ` --operation-id ` - Operation ID of the restore operation (required)
283+ - ` --wait ` - Wait for restore to complete if still running
284+
285+ ** Use Case** : This command is useful when checking the status of a restore operation or finalizing after completion.
286+
186287## Configuration
187288
188289The CLI uses configuration from Kubernetes ConfigMaps and Secrets with the following precedence:
@@ -258,13 +359,22 @@ See [internal/foundation/config/testdata/validConfigMapConfig.yaml](internal/fou
258359│ ├── elasticsearch/ # Elasticsearch subcommands
259360│ │ ├── configure.go # Configure snapshot repository
260361│ │ ├── list-indices.go # List indices
261- │ │ ├── list-snapshots.go # List snapshots
262- │ │ └── restore-snapshot.go # Restore snapshot
362+ │ │ ├── list.go # List snapshots
363+ │ │ ├── restore.go # Restore snapshot
364+ │ │ └── check-and-finalize.go # Check and finalize restore
365+ │ ├── clickhouse/ # ClickHouse subcommands
366+ │ │ ├── list.go # List backups
367+ │ │ ├── restore.go # Restore backup
368+ │ │ └── check-and-finalize.go # Check and finalize restore
263369│ ├── stackgraph/ # Stackgraph subcommands
264370│ │ ├── list.go # List backups
265371│ │ ├── restore.go # Restore backup
266372│ │ └── check-and-finalize.go # Check and finalize restore job
267- │ └── victoriametrics/ # VictoriaMetrics subcommands
373+ │ ├── victoriametrics/ # VictoriaMetrics subcommands
374+ │ │ ├── list.go # List backups
375+ │ │ ├── restore.go # Restore backup
376+ │ │ └── check-and-finalize.go # Check and finalize restore job
377+ │ └── settings/ # Settings subcommands
268378│ ├── list.go # List backups
269379│ ├── restore.go # Restore backup
270380│ └── check-and-finalize.go # Check and finalize restore job
@@ -276,6 +386,7 @@ See [internal/foundation/config/testdata/validConfigMapConfig.yaml](internal/fou
276386│ ├── clients/ # Layer 1: Service clients
277387│ │ ├── k8s/ # Kubernetes client
278388│ │ ├── elasticsearch/ # Elasticsearch client
389+ │ │ ├── clickhouse/ # ClickHouse client
279390│ │ └── s3/ # S3/Minio client
280391│ ├── orchestration/ # Layer 2: Workflows
281392│ │ ├── portforward/ # Port-forwarding lifecycle
0 commit comments