Best practice of stopping InfluxDB inside a docker container without stopping the container

Thanks, I got it! For anyone looking for instructions, here’s what I did.

  1. Stop the Influxdb container.
  2. Go to the persistent location of your influxd.bolt file and make a backup copy: cp influxd.bolt influxd.bolt.BAK
  3. Move your influxd.bolt file to a machine where you can install Influxdb natively (that is, not in a docker container). Adjust permissions as necessary.
    For me, this was my Windows machine. For others, the docker host machine may be fine for this purpose.
  4. Install Influxdb on this machine from here: Install InfluxDB OSS v2 | InfluxDB OSS v2 Documentation
    Follow the instructions to install, but don’t go any further – we don’t want to actually start influx on this machine.
  5. Open a terminal window in the location where influxd.exe is.
  6. Run the recovery auth create-operator .\influxd recovery auth create-operator --bolt-path [location of the bolt file from step 3] --username admin --org [your org]
  7. Move the now updated influxd.bolt file back to the original location from step 2
  8. Adjust the ownership and permissions of influxd.bolt to match influxd.bolt.BAK
  9. Restart the Influxdb container.
1 Like