The scope of this document is to provide a possibility to transfer data from Influx DB Version 1 to InfluxDB Version 2.
/var/lib/influxdb and /etc/influxdb), to your local machine. Why? Azure Filestorage, or other remote sources, might not work with the backup mechanisms of Influx, so we need a unrestricted file-system for these operations. If you are running Influx in docker, copy these files from their respective volume mounts.docker-compose file
version: '3'
services:
influxdb:
image: influxdb:1.8.4-alpine
container_name: influxdbv1
restart: always
ports:
- "8086:8086"
volumes:
- ./data:/var/lib/influxdb
- ./config:/etc/influxdb
# find ID of influxV1 container docker ps # execute bash in the container docker exec -itbash
influx_inspect export -database "dbname" -datadir "/var/lib/influxdb/data" -waldir "/var/lib/influxdb/wal" -out "/var/lib/influxdb/backup.lp" -compress -lponly
docker-compose file
version: '3'
services:
influxdb:
image: influxdb:latest
container_name: influxdb
restart: always
ports:
- "8086:8086"
volumes:
- ./data:/var/lib/influxdb2
- ./config:/etc/influxdb2
- ../influxv1/data/:/etc/influxbu # <-- this is the folder where the previously created backup is located
environment:
- INFLUXDB_ADMIN_USER=user
- INFLUXDB_ADMIN_PASSWORD=1234
# find ID of influxV1 container docker ps # execute bash in the container docker exec -itbash
influx write --org--bucket --token --file /etc/influxbu/backup.lp --compression gzip