InfluxDB - location of database on hass.io?

Hi,

Recently installed and setup influxdb with Grafana on my Rpi 3+, running Hass.io.

In order to prevent the database clogging my Pi, I am looking for a way to download the database from influxdb, so I can store it on my laptop (which is not always-on) - thereby only having maybe a month or two of data on my Rpi.

My issue is: Where and how do I find the database when running hass.io?
I have installed Portainer and am able to download an image of the influxdb-addon, but have no idea how to go from there.

My skill level is beginner.

Any help would be appreciated!

Thanks,

1 Like

Did you find out the answer?

On Home Assistant Supervised (previously known as hassio on generic linux), the database is in
/usr/share/hassio/addons/data/a0d7b954_influxdb/influxdb

I’m sorry @francisp but I can’t find that local with SSH.

1 Like

I didn’t, sorry. But the size of my database hasn’t changed much, if at all, for a long time, so clogging might not be such a big problem as I feared.

However, I’m still considering upgrading from an sd-card to an ssd-hdd, just in case.

In my case, it is :

image

How do you guys find out the location of this? I just installed 110.1 supervised on a NUC and I need to put my old influxdb database in the new location, but I don’t have a “hassio” directory in /usr/share/

Any ideas?

First look where your configuration.yaml is located.

sudo find / -name "configuration.yaml"

From there, one directory up, there should be a addons directory, look in there.

I have that directory, but it is empty despite having influxdb running.

Hi @comatose_tortoise,

Did you ever finde the location of the influxdb.
I’m trying the same. My ‘addons’ dir is also empty despite having influxdb (and other addons) running.

Thanks and br.
Søren

Hi SĂśren,

Unfortunately not. I didn’t find out how to transfer my old influxdb to my new NUC HA installation, so I just kept it running on the old machine, now only serving as an influxdb-server… Not ideal. Influxdb feels a bit like a black box if you’re not good at it. Kind of worrying for long-term data storage, but I don’t know what alternatives there are…

Thanks @comatose_tortoise, for your reply.

I just installed InfluxDB this weekend, so the DB haven’t been populated with data yet. (I’m new to Home Assistant)

Yes, it sure files like a black box… I’ll reply to you in this thread, if I find anything usefull.

BR Søren

Hi again, @comatose_tortoise

I got at step further.

From a Terminal session / SSH, you can run this command

docker exec -it addon_a0d7b954_influxdb /bin/bash

This takes you inside the docker that runs influxdb.

In the folder /data/influxdb you have the database - seems to contain three folders

/data = containing the database itself.
/wal = seems to be work area for the database, before commit or something.
/meta = not sure what that is.

Btw. if you execute ‘docker stats’ it will display all running dockers - here you can see the ‘name’ of your docker influxdb. I’m assuming it is the same as mine.

BR Søren

Hm, so you mean if I would put my old influxdb there (in the correct directories), it would work? Did you try it?

No, haven’t tried mysself.
My plan was to move the influx db away from the sd-card and onto a USB attached SSD.
But haven’t gotten to that part yet.

I am trying to do that same. All of the other documentation I can find says that it is in /usr/share/hassio/…, but that is not true in my case, where the HA OS is running. Instead, influxdb is installed as docker, and it is where @Soren_Birkholm_Eriks says that it is. I could not get there by command line, as he writes. It says that I have protection mode enabled, which is not true, either. I can find the location by using Portainer, opening the influxdb container, and using Console. It is indeed in /data/influxdb. Portainer shows that it is a mapped volume from /mnt/data/supervisor/addons/data/a0d7b954_influxdb.

I have mounted a network drive using the following

shell_command:
  create_database_directory: mkdir -p /mnt/database
  mount_nas_database_folder: mount -t cifs -o username=guest,domain=WORKGROUP //192.168.1.xx/HA_database /mnt/database

but I cannot find a way to make this mounted directory accessible to the influxdb container.

The InfluxDB add-in allows you to specifiy your own environment variables as per:

https://docs.influxdata.com/influxdb/v1.8/administration/config/#environment-variables

Did you try that?