Upgrade Influx 1.8.10 to 2.x failed

Only do this on a fresh influxdb2 install:
Tested on amazonlinux2. All steps should work for rpm distros: fedora, centos, redhat, OEL, etc.

– Do a fresh Install influxdb2 and influxdb2-cli
– If your influxdb2 is currently running, turn it off
– chown -R influxdb:influxdb all your influxdb1.8 data
– Perform the upgrade:

  • sudo -u influxdb influxd --v1-dir /path/to/influxdb1.8/data upgrade
  • follow the prompts for your new user, password, org, etc
  • rsync -azvpP /var/lib/influxdb/.influxdbv2/ /var/lib/influxdb/
  • start influxdb. This initial start may take a while depending on how much data you have. Don’t be surprised if systemd times out. You can always update your influxdb unit file [service]TimeoutSec=1000 or something.

If you want to make the CLI usable, you need to login to the webUI and copy out the API token you just created and export these env variables in terminal:
export INFLUX_TOKEN="<api_token>"
export INFLUX_HOST="<http/https>://localhost:8086"
export INFLUX_USERNAME="<api_token_username>"
You can try just adding the above values to /etc/default/influxdb2 but I haven’t had any luck with it.

If you want to use TLS, drop your certificates + key where you want them and add these lines to your /etc/influxdb/config.toml file:
tls-cert = “/path/to/certs/cert.{pem,crt}”
tls-key = “/path/to/cert/key/cert_key.key”

If you’re using a self signed cert you’ll have to use “–skip-verify” at the end of every influx command you run.

4 Likes