How to copy Influx 1.8 database to new server with influx 2.1?

Hi together, I have a hard time to move my old data to a new installation. How can I move my setup to a new system?

Old system:

  • Xubuntu 18.04 with influx 1.8
  • influf was started with /usr/bin/influxd -config /mypath/influx/influxdb.conf
  • influx holds 1 database with 1 user and was accessed with password by openHAB
  • the config file contains:

[meta]
dir = “/mypath/influx/data/meta”
[data]
dir = “/mypath/influx/data/data”
wal-dir = “/mypath/influx/data/wal”
wal-fsync-delay = “100ms”

I made a backup of the whole data folder cp /mypath/influx/data/data /mypath/influx/data/data.bak
Then I did a upgrade by removing and installing new influx:

sudo apt remove influx
wget -qO- ht tps://repos.influxdata.com/influxdb.key | gpg --dearmor | sudo tee /etc/apt/trusted.gpg.d/influxdb.gpg > /dev/null
export DISTRIB_ID=$(lsb_release -si); export DISTRIB_CODENAME=$(lsb_release -sc)
echo “deb [signed-by=/etc/apt/trusted.gpg.d/influxdb.gpg] ht tps://repos.influxdata.com/${DISTRIB_ID,} ${DISTRIB_CODENAME} stable” | sudo tee /etc/apt/sources.list.d/influxdb.list > /dev/null
sudo apt-get update && sudo apt-get install influxdb2
sudo /usr/share/influxdb/influxdb2-upgrade.sh
sudo systemctl start influxdb
influxd backup influxdbBackup

All this completed successfully. I gave the new user the previous name and password. The complete folder influxdbBackup was moved to the system.

New system:

  • Xubuntu 20.04 with influx 2.1 installed via same procedure:

sudo systemctl start influxdb
wget -qO- ht tps://repos.influxdata.com/influxdb.key | gpg --dearmor | sudo tee /etc/apt/trusted.gpg.d/influxdb.gpg > /dev/null
export DISTRIB_ID=$(lsb_release -si); export DISTRIB_CODENAME=$(lsb_release -sc)
echo “deb [signed-by=/etc/apt/trusted.gpg.d/influxdb.gpg] ht tps://repos.influxdata.com/${DISTRIB_ID,} ${DISTRIB_CODENAME} stable” | sudo tee /etc/apt/sources.list.d/influxdb.list > /dev/null
sudo apt-get update && sudo apt-get install influxdb2
sudo sudo service influxdb start

And now the trouble starts. The restore does not work, and it seems I do not have any access to influx from command line:

me@newmashine:/mypath$ influx restore influxdbBackup
Error: failed to check existence of organization “openhab”: InfluxDB OSS-only command failed: 401 Unauthorized: unauthorized access
me@newmashine:/mypath$ influx user list
Error: failed to list users: 401 Unauthorized: unauthorized access
me@newmashine:/mypath$ influx config list
Active Name URL Org
me@newmashine:/mypath$ influx setup
Error: instance has already been set up

Unfortunately I did not find how to reset the setup or user. I also can’t remember to have done any setup (like on the old system after upgrade). How to get the old data and setup into the new machine?

Thank you for help. Ju

@JG123 I think if you follow the documented upgrade procedure, it should work: