Restore says "must specify path to backup directory"

I’m trying to move a full backup of a running influxdb to another machine. I did the following.

I backed up all data from my influx, version 2.0.4, by issuing:

$ influx backup --host http://localhost:8086 backup/

Obs: Omitting --host but giving the --token gives me Error: Unauthorized access.. So I kept --host and it was enough for influx backup to work.

In that directory there is:

$ ls backup
20210513T141340Z.bolt        20210513T141340Z.s17.tar.gz
20210513T141340Z.manifest    20210513T141340Z.s18.tar.gz
20210513T141340Z.s10.tar.gz  20210513T141340Z.s1.tar.gz
20210513T141340Z.s11.tar.gz  20210513T141340Z.s2.tar.gz
20210513T141340Z.s12.tar.gz  20210513T141340Z.s3.tar.gz
20210513T141340Z.s13.tar.gz  20210513T141340Z.s4.tar.gz
20210513T141340Z.s14.tar.gz  20210513T141340Z.s5.tar.gz
20210513T141340Z.s15.tar.gz  20210513T141340Z.s6.tar.gz
20210513T141340Z.s16.tar.gz

Now at the machine where I will restore

I copied all files from the first machine to a local path using scp:

$ scp machinetobackupfrom@ip:/path/to/backup/* /local/path/to/backup/

I extracted influx binaries:

$ tar xvfz influxdb2-2.0.4-linux-amd64.tar.gz

Current directory looks like this:

$ ls
backup
influxdb2-2.0.4-linux-amd64
influxdb2-2.0.4-linux-amd64.tar.gz
config.yaml

My config.yaml is:

$ cat config.yaml 
engine-path: /data/influxdbv2/engine
http-bind-address: ":8085"
bolt-path: /data/influxdbv2/influxd.bolt

I have cleaned /data/influxdbv2/ directory:

$ rm -r /data/influxdbv2/*

When I try to restore the data I get this error:

$ influxdb2-2.0.4-linux-amd64/influx restore --full --input backup
Error: must specify path to backup directory
See 'influx restore -h' for help

Then I tried to restore the data with influxd running.
I go through influxd setup and start my influx like this, as it reads the config.yaml file at current directory:

$ influxdb2-2.0.4-linux-amd64/influxd

I tried to restore the data again but I get the same Error: must specify path to backup directory.

Even using full path for --input I get that error.

$ influxdb2-2.0.4-linux-amd64/influx restore --full --input $(pwd)/backup
Error: must specify path to backup directory
See 'influx restore -h' for help

Removing the --input flag gives the same error. It’s clearly not reading this flag.
I have download version 2.0.6 and retried to restore my backup but I still get the same error.
I have no idea what I am doing wrong.

@cassiohg sorry for the frustration, after looking at the code I see the help text is incredibly misleading. I’d expect this to work for you:

influx restore --full $(pwd)/backup

I’ll make issues against our public docs site and the main influxdb repo to improve this.

Worked perfectly.

The restore steps are

  1. extract influxdb
  2. run influxd
  3. execute influx setup --host <address> --token <source influxdb token>
  4. setup anything as this will be overwritten by the backup’s metadata.
  5. now execute influx restore --full <path/to/backup> --host <address> --token <source influxdb token>

obs: --host can be omitted if default address is http://localhost:8086

I advise coping the token along with the backup when moving things somewhere else. I have my token written on a file just so I can $(cat token) in every cli command.

And what if someone doesn’t want to do a full restore? For example, I have a backup taken ages ago from an instance that no longer exists, and I have no idea what the token is, or care about the org and tokens. I just want to get the data in.

Edit: managed to track this down in git. Love when people make things complicated :wink: TL;DR: --input doesnt work, so just put the path as the last argument e.g. influx restore --your --options /var/backup/001

According to the restore page in the docs: https://docs.influxdata.com/influxdb/v2.0/backup-restore/restore/#restore-all-time-series-data
You can just leave out the --full to restore only the time series data.

Thanks, that wasn’t the issue though - the vital explanation of “just put path as the last argument” was missing from the thread.