A few people have had trouble using backup and restore of influxdb inside Docker, so I wrote a small script demonstrating how to back up and restore a database, in this gist. If you’ve had trouble with backup and restore inside Docker, you should be able to use that script as a reference to make backup and restore work in your setup.
Some of the issues people are running into include:
General difficulties around influxdb inside Docker, particularly:
Stopping the influxd process which kills the container
Needing to restore into a volume from an ephemeral container
We’re looking into how to make this workflow easier. Right now, it seems like the most user-friendly answer will be to allow influxd restore to run correctly without stopping the influxd process, but we are still considering whether any other approaches make sense.
I need to backup the influxdb from another docker container running a NodeJS application that uses data stored in influxdb and has also backup/restore functionalities. To be able to use influx cli commands inside this container I have installed influx there too but it is not started, this way I can use the influx backup command.
I have just added this lines to my nodejs container Dockerfile: