influxdata / influxdata/influxdb
Perform a restore from recent backup
- Dominant language
- Rust
- Stars
- 31.7k
- Forks
- 3.7k
- Avg merge
- 13h 37m
- Merged PRs (30d)
- 8
Description
I am doing a backup with:
`influx backup "$INFLUX_BACKUP_PATH" -t="$INFLUX_ROOT_TOKEN"`
The backup is performed. When I try to backup:
```
pablo@pablo-MII-V:/dev/shm$ sudo influx restore /dev/shm/influxdb_backup --token ""$INFLUX_ROOT_TOKEN""
2025/01/21 21:10:23 INFO: Restoring bucket "196e269b74ba658d" as "cpe_periodic_reports"
Error: failed to restore bucket "cpe_periodic_reports": 422 Unprocessable Entity: bucket with name cpe_periodic_reports already exists
```
If I delete the bucket:
```
pablo@pablo-MII-V:/dev/shm$ sudo influx restore /dev/shm/influxdb_backup --token ""$INFLUX_ROOT_TOKEN""
2025/01/21 21:24:08 INFO: Restoring bucket "196e269b74ba658d" as "cpe_periodic_reports"
Error: failed to restore bucket "cpe_periodic_reports": 401 Unauthorized: read:authorizations is unauthorized
```
Finally with the --new-bucket flag:
```
pablo@pablo-MII-V:/dev/shm$ sudo influx restore /dev/shm/influxdb_backup --new-bucket --token "uLdH_rC1K5EpO6eFmGHRhBzRTdI4t8oBWHqFDxyIOsrN9-RG_lfHYJR_vTb4oR6o1u9KbK57-iR4siVq_jBleA=="
Error: --bucket-id or --bucket must be set to use --new-bucket
```
Its obvious but anyway I will clarify that there are more than just 1 bucket in the backup, so I don't understand why always a bucket is referred when the backup was performed generally.
It will be great to understand which kind of madness is this.
Thanks in advance.
Pablo.
Contributor guide
Research direction
Start by reproducing the `influx backup` and `influx restore` commands shown in the issue, including the existing-bucket, deleted-bucket, and `--new-bucket` cases. Trace how restore selects buckets and handles the reported 422, 401, and flag-validation errors. Done means the multi-bucket restore behavior and required authorization or flags are clearly corrected or documented.
Written by the indexing model from the issue text.
Assessment
- Domain
- cli, databases
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 28/100