How to restore a database?

Hello all, Trying to backup and restore a database. It seems to work, but the database is no longer available. /var/lib/influxdb/data. Was thinking maybe I am restoring it to the wrong place, but /etc/influxdb/influxdb.conf seems to agree with where https://docs.influxdata.com/influxdb/v1.3/administration/backup_and_restore/ states to restore it. Can anyone shed any light? Thank you

[michael@devserver ~]$ influxd backup /home/michael
2017/10/05 16:49:55 backing up metastore to /home/michael/meta.00
2017/10/05 16:49:55 backup complete
[michael@devserver ~]$ influxd backup -database test_subquery2 /home/michael
2017/10/05 16:50:10 backing up db=test_subquery2 since 0001-01-01 00:00:00 +0000 UTC
2017/10/05 16:50:10 backing up metastore to /home/michael/meta.01
2017/10/05 16:50:10 backing up db=test_subquery2 rp=autogen shard=190 to /home/michael/test_subquery2.autogen.00190.00 since 0001-01-01 00:00:00 +0000 UTC
2017/10/05 16:50:10 backup complete
[michael@devserver ~]$ /usr/bin/influx
Connected to http://localhost:8086 version 1.3.5
InfluxDB shell version: 1.3.5
> show databases
name: databases
name
----
_internal
temp_1865094168
temp_1586701055
temp_1104665423
temp_1974750116
prod
test_subquery2
test_subquery
test_fill
> use test_fill
Using database test_fill
> drop database test_subquery2
> show databases
name: databases
name
----
_internal
temp_1865094168
temp_1586701055
temp_1104665423
temp_1974750116
prod
test_subquery
test_fill
> exit
[michael@devserver ~]$ sudo systemctl stop influxdb
[michael@devserver ~]$ influxd restore -database test_subquery2 -datadir /var/lib/influxdb/data /home/michael
Restoring from backup /home/michael/test_subquery2.*
unpacking /var/lib/influxdb/data/test_subquery2/autogen/190/000000002-000000002.tsm
restore: error making restore dir: mkdir /var/lib/influxdb/data/test_subquery2: permission denied
[michael@devserver ~]$ sudo influxd restore -database test_subquery2 -datadir /var/lib/influxdb/data /home/michael
Restoring from backup /home/michael/test_subquery2.*
unpacking /var/lib/influxdb/data/test_subquery2/autogen/190/000000002-000000002.tsm
[michael@devserver ~]$ sudo chown -R influxdb:influxdb /var/lib/influxdb
[michael@devserver ~]$ influx -execute 'show databases'
name: databases
name
----
_internal
temp_1865094168
temp_1586701055
temp_1104665423
temp_1974750116
prod
test_subquery
test_fill
[michael@devserver ~]$

This may indeed be a bug. I’d suggest filing an issue about it on GitHub.

dg