influxdata / influxdata/influxdb

Unable to restore backup to existing bucket

Open
#20,758 9 comments 2 reactions 0 assignees View on GitHub
area/2.x area/backup and restore
Dominant language
Rust
Stars
31.7k
Forks
3.7k
Avg merge
13h 37m
Merged PRs (30d)
8

Description

__Steps to reproduce:__

1. Create backup `# influx backup -b bucket1 ~/influxdb-v2-export/`
2. Copy files to different server where bucket already exists with data in it
3. Attempt to restore `# influx restore -b bucket1 ~/influxdb-v2-export/`

__Expected behavior:__

Data is restored to existing bucket along side the already existing data in that bucket.

Documentation ([https://docs.influxdata.com/influxdb/v2.0/reference/cli/influx/restore/](https://docs.influxdata.com/influxdb/v2.0/reference/cli/influx/restore/)) provides an example for restoring data to an existing bucket separate from restoring to a new bucket.

__Actual behavior:__

Errors out saying "cannot create bucket".

```
2021-02-15T19:34:58.266935Z info Resources opened {"log_id": "0SLnrsqW000", "path": "influxdb-v2-export/20210215T185834Z.bolt"}
2021-02-15T19:34:58.267266Z info Restoring organization {"log_id": "0SLnrsqW000", "id": "583d63a670ab779c", "name": "org1"}
2021-02-15T19:34:58.268984Z info Restoring bucket {"log_id": "0SLnrsqW000", "id": "04ea7e91e2f1a222", "name": "bucket1"}
Error: Cannot create bucket: bucket with name bucket1 already exists.
See 'influx restore -h' for help
```

__Environment info:__

* System info: Linux 4.18.0-277.el8.x86_64 x86_64
* InfluxDB version: InfluxDB 2.0.3 (git: fe04d346df) build_date: 2020-12-15T01:00:16Z
* Other relevant environment details: Source and destination systems are running identical version of InfluxDB

Contributor guide

Open the contributing guide

Research direction

Start with the `influx restore` CLI command and reproduce the backup and restore steps against an existing bucket. Trace the restore behavior described in the issue and verify that existing bucket data remains while backup data is restored without the "cannot create bucket" error.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
cli, database
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.