Recommended way to backup/restore OH2 configurations and things?


(Thefathefa) #101

Thanks Markus, I think I see it for Grafana, yes, but what about influxdb? If the only way to do backhup is to use influxdb backup then, I’m not sure how Amanda would work?


(Markus Storm) #102

Well I don’t know where influxdb is placing its data but as can be seen in the script above you can actually run an influx command to create a backup. Place these into a directory and add that to Amanda disklist.


(Rich Koshak) #103

Usually its /var/lib/influxdb.


(Thefathefa) #104

@mstormi, thanks for this.
I’m trying to have all the backup related stuff in one place and was looking at how to configure a script to be executed before Amanda performs the backup but before I spend time on this I was wondering if any of you are backing up influxdb by just backing up the folder mentioned by @rlkoshak Rich (Usually its /var/lib/influxdb). Something tells me it is probably not a good idea, but I thought I’d check.


(Bob S) #105

As I could not find the public location of the source, I am asking here. My
openhab-cli backup (or /usr/share/openhab2/runtime/bin/backup) does actually not produce a file , I think due to a bug towards the end of the file.

a) is this known?
b) where is the right place to provide a pull req ?


(Rich Koshak) #106

@Benjy, any ideas about a potentail bug in the backup scripts?


(Ben Clark) #107

I think I see the same thing, but only when naming a file right?

If you found the error already the place for a PR is https://github.com/openhab/openhab-linuxpkg and it would be very much appreciated :smiley:


(Ben Clark) #108

Sorry @rlkoshak and @alias that was completely the wrong link… Not sure how I screwed that one up… The following is a direct path to the github file…


(Ben Clark) #109

Hi @alias, I found the bug and submitted a PR, could you confirm that this fixes the issue?


(Andrea Riela) #110

Guys,

I need to move from one VM to another.
The original VM is Debian 32 bit with latest openHABian (OH2), and I would like to move to Debian 64 bit (as Grafana 32 bit is not supported).

Do I need to install java 32 bit? is sudo openhab-cli backup/restore the right way, considering I’ve also a lot of zwave devices (xml files to be moved as well)?

Any suggestion will be appreciated

Thanks
Andrea


(Rich Koshak) #111

Backup and restore scripts will grab everything.

Though if the new VM will be running the same OH version, you can just copy over /etc/openhab2 and /var/lib/openhab2 to the new VM and you will have everything.


(Markus Storm) #112

Uhh, now while not completely wrong, that’s a somewhat dangerous statement.
A typical openHABian setup consists of more than just plain OH and it’s config files: mosquitto, NGINX, …


(Rich Koshak) #113

True, I was only addressing the OH part since that is what Andrea was asking about.

As far as I know, there is no automated or even complete guide for dealing with migrating everything that openHABian can install to a new machine.


(Andrea Riela) #114

and what about Oracle Java? still makes sense to use the 32 bit or can I install the 64 bit version?


(Rich Koshak) #115

Unless you are running an ARM VM the 64-bit should be fine.

https://docs.openhab.org/installation/index.html#prerequisites

Take heed of Markus’s posting though. Copying the etc and var/lib folder only addresses OH’s configuration. Any custom configuration you have done with any services installed by openHABian needs to be backed up and moved over as well.


(Pune2001) #116

Nice script. Helps me avoiding all the trouble I have with Amanda. Do you have a script for restoring the data as well?