Docs on how to backup openHAB

Thank you alot for clarify this part.
Just to make 100% clear - Does it mean that running the backup script on openhab 2.0 and restore in 2.5.5 (or any other combination) will work fine?

Why?

It might do at the installation page allright. I´m mainly interested in having the backup (word as well as an easy procedure) pushed forward somehow, because I think its a highly important task when dealing with a system such as a smart home system which is meant to be running 24/7.

Good initiative to improve this part. I did started with openhab 2 years ago without any Linux experience and a very important thing is to have a backup of your configuration. And when you are new, it’s sometimes hard to follow explanations since somebody expects another to have some base knowledge. But with an important topic like a backup/copy of your config (making sure you do have to start all over again when you screw it) is a newby explanation very helpful.
Unfortunately I cannot help you at the moment with the open questions, but will follow the topic and jump in if I can.

2 Likes

Thank you very much for your support… Whenever you feel like, you just jump in and add whatever is on your mind! (regarding the subject :smiley: ).

1 Like

Not quite, files you copy in from a backup on an older version would overwrite files in the newer version. If there are necessary changes, such as a keyword change then the restore script won’t do them automatically.

Because it’s linuxpkg specific. Ideally you would talk about the backup procedure once. A single sentence describing the openhab-cli shortcut will be okay, but for documentation sake “The included backup script” is a cover all for every OS.

Okay thats what I thought. Just needed someone to clarify.
I have seen some using it to move the configuration from one system to another (like from a Rpi3 to Rpi4). I guess this would only be safe to do, if the destination system is running the same openhab version. Which make it highly important to notice.
It can however become a problem, if someone is running an older version, and this version isnt available for downloading, (ie 2.0) Then the user will have to update the system to latest before doing the backup. Which can become a problem, if the system is crashed.
Are all older openhab versions available for downloading?

Another question.
Do you know whats the difference between openhab-cli backup and openhab-cli backup --full is? Is it only cache included in --full? Personally I wouldnt recommend backup a cache. I prefere the system itself rebuild the cache insted, even though it will take a while. But it needs to be explained for others who may have another opinion about the cache.

I have no idea how Mac works. But in windows I would assume the user would just copy the folders, (or make their own scripts which basicly do the same). In worse case, they could use Windows backup and a scheldule task. I dont quite see why a windows user would start a ssh session to enter linux (openhab-cli) commands. But it has been too long since I tried openhab for windows, so I wouldnt know if this is required.

Again, for the sake of documentation of all OS: $OPENHAB_RUNTIME/bin/backup --full

The --full option includes cache and tmp directories. Useful now if you want exactly the same binding versions. Without the option the backup is configuration only, and much more likely to work across different versions.

Mac and Linux run the $OPENHAB_RUNTIME/bin/backup script, Windows runs the $OPENHAB_RUNTIME/bin/backup.bat script. These do the same thing which is not as simple as copying the files across. There are a few system files in the $OPENHAB_USERDATA directory that should not be changed or replaced.

Why are you here? It doesn’t seem like you want to help. You’re telling @Kim_Andersen not to nit-pick words but that’s what you were doing from the very beginning of this thread. A menu is often something where you click a thing and other things that you can click appear. That very thing is on the docs with a list of chapters. Maybe there is a more precise term that could have been used, but surely you could figure out what Kim was talking about.

And look at the original post. It says that there is not good documentation and it attempts to start the conversation about making some by sharing a couple of ideas and asking for help. You say that openhab doesn’t have “backup” and it’s the user’s job to contribute that and to understand what files need to be backed up, etc. That’s what Kim is trying to get started!

Please back off of the aggressive tone and think about whether something is adding to or subtracting from the conversation of a user that is trying to help before posting it.

And Kim, good for you for sticking up for yourself!

11 Likes

Because I wrote that section of the docs Kim references, and he’s misinterpreting them.
It’s actually not even openHAB docs but actually part of openHABian, which makes for a major difference because it’s different software and different people who wrote those docs.
I know that’s not obvious to a user but that’s also why the exact meaning of “menu” is so important in this case.

No that’s not what I said. Read again. I said openhab-cli is not a backup tool but Amanda is.
openhab itself will never ever “backup” everything a user would want to have backed up because it only
has access to the OH config but not to any persistence data, logs, and and other relevant runtime data like that stored in databases, Grafana and so on.

But backup for openHAB to include all of that IS THERE. It’s → Amanda <-. You just won’t find it in the docs menu structure below/for “openHAB” because it isn’t part of openHAB.

Hence there’s not even a need for this thread IMHO.
That’s what I tried explaining but obviously failed. That’s why I was here to help.
FWIW, I also was the person to contribute Amanda to openHAB/openHABian, including extensive docs that Kim admitted he didn’t even read.
But I’ve given up on discussing, I’m out.

Huh!!

This is what I wrote about Amanda:

"I know Amanda has been documented somewhere (I didnt search specific for this, but I have seen tons of forum post regarding Amanda ). Amanda has also been partly documented regarding openhabian-config… Perhaps it just need to be placed in a “ Backup menu ” in Openhab documentation. I think Markus has already done a great job of documentation for this, right?

For the second possibility, openhab-cli backup , the situation is worse,…"

The last sentence is the reason why I did not read nor focusing on Amanda. Why should I, when I dont think there is a problem with it, (except the document is misplaced, in my opinion).

Just to let you know… I have not given up on this… I´m actually planning to do a “real live” backup and restore from my Rpi3B+ to my Rpi4. Unfortunatly my rpi4 is quite busy at the moment troubbleshooting the ipcamera binding for Matt. But as soon as he get it fixed, I will use my own system to do this, and then make a few screenshots from it as well. I believe such an example would be great for having in the documentation/guide.

2 Likes

How I prefer to
Do it linked below. Plus I also do full textual config so I only have to backup files and can blast away the entire system and drop the files back and I have a working system.

1 Like

Very nice guide, Matt!

Image backup is highly effective. But… (there is always a but…).
When using small SD cards, this is a very good way of making regular backups. But using a rather big storage, (Harddrive, SSD etc.), image backups can be a pain. It takes longer to backup, and it takes longer to restore. Also the bigger size storage using, you´ll have to make more free space available on the storage where you keep your backups.

What I specially like in your guide, is your suggesting of having backup hardware as well as an UPS. I totally agree on that, (though I havn´t got my UPS yet, due to other issues like changing hardware quite often, which makes is a bit difficult to count how big the UPS is going to be, except for big enough.As well as dealing with, exactly what to connect to the UPS. I would prefere everything regarding smarthome/openhab, internet etc… (Bad excuse, I know… I´m lazy. And fortunatly we´re not suffering for lots of power outbreaks here in Denmark :roll_eyes:)).

You can always install two ups, does not all need to be be in the one. Ones which can notify a system to shutdown are great.

I use 64gb usd cards and my backups take up less than 2gb each and are fast to make and restore as the program skips blank space on the drive. Works well for me.

Yep, I read your article. And my plan is to get one bigger ups, and then install the server/client system on each.

The worse part of image copying is, if you have to shut down the system, take out your card, insert it into another system to do the copying, and then back to the original system, which you have to start up again… This is a procedure which requires a hard discipline and only very few people will do often enough. At least thats my experience.

Amanda already does all of that. No extra cards, no shutdown needed, it also compresses the image.
I don’t understand why you are discussing that. Just for the sake of … yes, what of? To not use Amanda at all cost?

You dont want to understand.

I´m 110% positive everybody would love to use a automatic backup procedure.

1 Like

It’s there. It’s called Amanda. openHABian menu option 52.
That’s why I don’t see the point in this whole thread.

If you have read the comments almost every time Amanda has been mentioned, you should be able to figure out why. But as I have tried to tell you a dozen times now… You dont read, nor listen or even trying to understand the reason. So you will never be able to get it. I tried a coupple of years ago, which just ended with you beeing highly unpolite and arrogant. I dont see any reason to start all over again.
But I will give you a slight hint (once again) - Not all users are equal! When you expect them to be, you will fail big time!

No, not at all.
If anyone on this thread (including you, Kim) could please explain in clear, concise words,
what’s missing or wrong about Amanda to be a comprehensive backup tool, please do.
But no references please, as these are usually interpretations or outdated and result in misunderstandings which I think is happening here all the time.
Just clear, concise but comprehensive wording.
Should be a snap if it’s so obvious, shouldn’t it ?

A coupple of years ago I had to argue with you, because I said Amanda is to difficult to comprehend.
As I said back then - A backup procedure should be easier to setup and use, than the actual system its suppose to backup.

Amanda is NOT easy. This is what I have read most people say about Amanda - It is difficult to setup.
Amanda requires high Linux knowledge as well as some special network knowledge if you want to use a network share. When it requires high Linux knowlegde, it is NOT easy for someone not knowing Linux. Even setting up a network share can/will can become a problem for some people.

When something become difficult to understand and to setup, its either not going to be used, or there will be tons of threads where people asking for help. This is a general fact!

Your opinion and answer was quite clear back then - I/users had to go study Linux. And you refuse to help people asking for help, if they havnt even given it a try.

This is why I wrote in my previous post:

Note - I am NOT going to argue with you again. So dont even try to get me started! You made your point very clear back then. I gave up on Amanda, which is why I do not focus on Amanda in this thread. Amanda is an option for those who have the knowlegde. And thats fine. But for those who havnt or cant waste their time studying high knowledge Linux there are alternatives which requires and do less, but still usefull and better than nothing.

I still believe openhab should supply with a better alternative of doing backups. But it seems like I´m the only one with this opinion, which is why I no longer provide ideas or suggestions.
I focus on whats possible in a reasonable manner, and will provide whatever help I can from this, by the use of openhab-cli.

2 Likes