Influxdb restore : does it really add the data from backup to the restore destination without erasing everything?


I am migrating my config from one openhabian system to another and I’m trying to do that step by step to be sure that I regain some control and refresh my understanding of it…

One thing that I’d to check is for the influxdb restore : based on what I read in influxdb site, I can configure my target system and migrate the items gradually to it, and have the target system store in influxdb the new values for the migrated items. And then, when I’ll be ready, I can take the source influxdb backup and restore it and it will simply add my history to the new database.

Can someone please confirm that my understanding is correct? That would make the transition simpler and safer…

Thanks in advance,

Quite interest in following this.
I plan to migrate my server sometime sonner rather than later and the last time I did that I lst my influx data. Not a big deal but I would I liked to keep it. Now I have two years of data and some of that is quite interesting.

I usually just backup and restore the whole database when needed. It´s a simple task to do. One thing I noticed though last time I did this. I had to created the database (empty) on the destination using the same database name and user/pw.
Then the backup and restore only take a few seconds.

1 Like

Update : I tried ot use the capability I was refering to above with no luck… I’m not too sure why it is mentioned as a feature, if it is confirmed it is not supported…

I tried to get confirmation of the non support by asking a question here. We’ll see where it goes. In the mean time, I chose to restore my history backup in a openhab_db2 database, and did “manual import” of the new recent (and smaller database) into this _db2 database. I switched openhab to -db2, did the same with grafana and it seems I’m good to go.

and how do you backup and restore it on openhab?
I tried to clone my SD, but the clone didnt boot, so i startet from scratch and restore my config backup on a new pi. The problem ist, that influxdb and grafana arent in the openhab backup so I have no idea how to get to my stored data and grafana again on the new system?


There is a build-in CLI for influxdb, in where you can execute the backup/restore command.
As far as Grafana goes, depending on which version you´ve got, there is a backup solution. But I have struggled with it, so i simply chose to export all the dashboards as json files, and then re-import them in the new setup. Rumors said you can just copy the grafana directory which contains the data. But I havn´t tried.

After last re-build of my system on a new hardware, I decided to leave Influxdb (as well as MQTT broker) on my old hardware, and just told the new setup where the database is located (local IP). The same goes for Grafana, which is now running on my Windows server. This way whatever happens to my openhab setup, which not have any influence on influxdb, MQTT broker or Grafana.

Here is a good link to show how to backup influxdb and grafana:

Thank you. I will give it a try.
Your solution would be much smarter and I think it would olso be possible to have the DB on the NAS.
I own a QNAP nas but my linux skill aren´t good enough to pull this off, so I think i have to deal with the provided solution.


1 Like