To export all data from an InfluxDB bucket the “influxd inspect export-lp” command can be used. This will export the data from that bucket in a Line Protocol format. This will make re-importing to Influx a very simple process.
Exporting Data:
For Linux-native installations:
influxd inspect export-lp --bucket-id 234324jk234yourbucketid --start 2025-01-01T00:00:00Z --end 2026-01-25T23:59:59Z --engine-path /var/lib/influxdb2/engine/ --output-path /var/lib/influxdb2/export.lp
For Docker Installations: docker exec -it influx /bin/bash -c "influxd inspect export-lp --bucket-id 234324jk234yourbucketid --start 2025-01-01T00:00:00Z --end 2026-01-25T23:59:59Z --engine-path /var/lib/influxdb2/engine/ --output-path /var/lib/influxdb2/export.lp"
Importing Data:
Note: The command below utilizes the Influx client as opposed to the native server binary that the export command uses. The client can be downloaded from Influx directly: https://docs.influxdata.com/influxdb/cloud/tools/influx-cli/
influx write --bucket-id 234324jk234yourbucketid -f export.lp --format lp
Terminology Notes:
- bucket-id IS NOT the bucket name. The bucket-id can be found from from the InfluxDB web server:
- influxd is IS NOT the same as influx
- influxd is the server-side binary that runs the server application
- influx is the client-side binary that allows users to connect to the server via a CLI
Recent Comments