How can I find my data after upgrade

I have some data loaded in Influx 1.8. I have successfully upgraded to v2 with the command influxd upgrade --v1-dir $influxdb_path. The log reports a successful upgrade, and the data folders have similar sizes (~37 GB), so the data is there. Unfortunately, I cannot find it.

The upgrade process asked me to create a user, a bucket, and an organisation. It seems my data is not attached to any of them. I have tried to create a new bucket with the original name of the database, but it is empty.

What am I missing?

Thanks!

@DavidMH each of your DB/RP pairs from 1.x should have been converted to a 2.x bucket of the same name (<db-name>/<rp-name>). What’s the path of your upgraded 2.x data folder? What command are you using to launch your upgraded 2.x instance post-upgrade?

1 Like

The data is in ~/.influxdbv2/. I am launching influx as a service from systemctl, the configuration as given in the original rpm, just /usr/bin/influxd.

Our systemd wrapper configures the influxd process to read config from /etc/influxdb/config.toml, can you check if it exists and (if so) what values it has set for bolt-path and engine-path?

By default I believe it will be looking for data under /var/lib/influxdb/. If you see that in the config, you could move the contents of your ~/.influxdbv2 under that path. You may need to chown influxdb:influxdb the directory after copying the files.

1 Like

You are correct, it was looking at /var/lib. I don’t have much free space in the root directory, so I created a symlink from /var/lib/influxdb/ to ~/.influxdbv2 and chowned the contents. I have also verified the permissions of the contents are the same as in the original /var/lib/influxdb.

Still, I cannot find the original data.

Some pieces of our storage engine don’t work well with symlinks. I’d instead recommend updating /etc/influxdb/config.toml to point directly at your data in ~/.influxdbv2. The bolt-path setting should contain the absolute path to ~/.influxdbv2/influxd.bolt, and the engine-path setting should point to ~/.influxdbv2/engine

1 Like

That is some progress!

So, I wrote the full path in /etc/influxdb/config.toml:

bolt-path = "/home/david/.influxdbv2/influxd.bolt"
engine-path = "/home/david/.influxdbv2/engine"

Starting influxd from systemctl doesn’t work, but if I run it as root it does. Ok, we’ll get to that later. But strangely, it looks for the bolt database in /root/.influxdbv2/influxd.bolt.

If I add my user to the influxdb group and start it as such, I get to see the bucket: frenymlab/autogen, but in the data explorer it is empty. No tags, no measures, no nothing.

I am not sure why, but for some reason, that particular bucket is set the retention time to 60 days. Changing to “Never” doesn´t seem to stick. I can change the duration, though. There is another bucket with the same policy, test/autogen that is rightly set to never expire. The data is still there, though, given the size on disk; and even within 60 days I should get some data.

Do you have any idea what went awry? Should I scrap this an re-load everything again?

So, now it is solved. I started the upgrade process from the beginning, but doing the following:

  • Avoided using symlinks. V1.8 was running directly on /var/lib/influxdb, since I have enough space.
  • Created an user in V1.8. I don’t think this actually made a difference, since it had admin privileges and was not upgraded, according to the log.
  • Ensure the retention policy in V1.8 was set to INF.
  • Make sure no influxdb instances are running. Then upgrade with the package manager.
  • Run influxd upgrade --v1-dir /var/lib/influxdb as user, which creates /home/david/.influxdbv2. Write that in /etc/influxdb/config.toml. The ownership of this folder is now in the user david:david, not influxdb.
  • Run influxd as root. (systemctl cannot find it, I think I need to restart for that).
  • http://localhost:8086/ has my bucket. Yay!
  • Back up!
1 Like