Persist influxDB data between machines with docker

Hey

I’ve switched my openhab installation on my Raspberry PIs from openhabian to Docker with containers.
There is one thing I can’t wrap my head around regarding the influxDB. When I restart the influxDB container my data gets persisted as expected, but if I try to switch the machine and move everything to another Raspberry PI, only the database settings are stored, but all the time series data is lost. It seems like influxDB doesn’t save all the time series data in the /var/lib/influxdb folder and put it somewhere else (RAM or another folder). But then, why is the data persisted if I reboot the system and start the container again? As far as I understand it no data outside of the defined volumes is saved when a container is restarted.

I’m asking this because it would be great if I could simply backup all the data of the influxDB container to have a backup of the influxDB without using the build-in backup solution influxd backup -portable ... which has it’s own downsides.

I spin up the influx container using docker-compose with this content:

services:
  influxdb:
    image: influxdb:1.8.6
    restart: always
    container_name: influxDB
    volumes:
      - ./influxDB_data:/var/lib/influxdb
    ports:
      - "8083:8083"
      - "8086:8086"
    environment:
      - INFLUXDB_ADMIN_USER=admin
      - INFLUXDB_ADMIN_PASSWORD=xxxx
      - INFLUXDB_DB=openhab_db

Thanks and best regards
Philip

This is going to be a question that is best answered on an InfluxDB forum. It’s not an openHAB question and the number of users running InfluxDB in Docker on this forum is pretty small.

Thanks for the reply. I already posted it on Stackoverflow, but you may be correct that it’s a good idea to ask it at the influx people directly :+1: