Move to new hardware incl. Influx and Grafana

Hi,
i’ve modify my RPi 3 with an M2 SSD via USB. I’ve installed Openhabian as a fresh install and clone my configuration to this new system. Works.

After this i’ve installed InfluxDB and Grafana, restoring Grafana was easy. InfluxDB was daily backuped with influxd backup -database openhab_db. I imported this with influxd restore to a new database. Connection from Grafana to Influx works, Openhab writes new data to Influx, BUT all my old data won’t show in Grafana.

I don’t know whats wrong, if not all data are imported to Influx or Grafana won’t how old data.

Any hints?

Greets
Huaba

It isn’t enough to just restore the backup in InfluxDB I think. You need to separately create the user and database before you restore the backup.

I’m no InfluxDB expert though so I could be wrong.

You are not using the -portable option? If not, you need to make sure you follow the 2 steps in the legacy section of the restore. See this: https://docs.influxdata.com/influxdb/v1.7/administration/backup_and_restore/#restore-legacy

The database exists after restore and Grafana use this database. I created the users and grant access.

No, i don’t use the -portable option.

I’ve backuped via cron with influxd backup -database openhab_db /srv/.backups/influx/ > /dev/null, imported the meta with

influxd restore -metadir /var/lib/influxdb/meta /srv/.backups/influx/

And imported the data with

influxd restore -db openhab_db -newdb openhab_db -datadir /var/lib/influxdb/data/ /srv/.backups/influx/

Afterwards i changed ownership of /var/lib/influxdb/data/openhab_db from root to influxdb because influxd couldn’t start in case of wrong permissions.

My .backups/influx directory has 1.8GB but the imported data in /var/lib/influx/data/openhab_db has only 21MB.

Oh, i copied the /var/lib/influx/wal directory to the new installation, now it works…

1 Like

Hi,
I am stuck at the final step you mention. I tried to copy /var/lib/influxdb/wal as sudo but got Permission denied . Checked ownership and it say /wal is owned by systemd Core Dumper.

Any tips on how to copy that to the new install?

I’m not exactly know, what i’ve done. But have you tried to stop influxdb before copying?

Huaba

That actually worked! Thanks for the help

Gibber