All settings lost after an apt-get upgrade

Hi,
I’m running OH 2.X installed from repository.
I did dayly update for a while, without loosing settings. Then I stopped to update since 10 days until tomorrow. After tomorrow’s update, all settings are loose.
I lost all PaperUI settings, installed bindings, all preferences, HabPanel Layout. Only Things configured by PaperUI are present.

It is normal behaviour?

Where this setting are saved? What I should backup?

Thanks

Take a look at:

./runtime/karaf/bin/oh2_dir_layout and services/addons.cfg

Regards S

Hi @Seaside
in folder you mentioned there is not subfolder:

Beside this, is this normal that I loose all settings after an apt upgrade?

Regards
Marco

Hi!

I’m not using the aptget update myself right now. But if the dirlayout is overwritten, which happened to me when I moved from beta to snapshot, you will face some problems.

The addons.cfg file is located for me under /etc/openhab2/services/addons.cfg
But the location depends on oh_dir_layout configuration. In addons.cfg you can specify what bindings to install, so when you install a new version with apt those add-ons will be automatically install during the startup of openhab.

Hi @Seaside
thanks for explanation. Now is clear. But I would like to know where all settings performed with PaperUI are stored, in order to backup them automatically overnight.
In Openhab 1.X, I backup all /opt/openhab/* folder, now I’m trying to collect all part to back. For emaple in OHab2 I have to backup /etc/openhab2, /var/lib/openhab2/persistence/rrd4j, /usr/share/openhab2/runtime/karaf/etc, but I have not understand where settings are saved.

Marco

Thanks for help, i setup a daily back of that folder.

I have not understood yet, because I lost all my settings after an apt upgrade

Marco

Almost the same scenario happened to me a couple of days ago. Needed to reinstall all my addons and after that openHAB2 was back to normal.

Same as me, so something happened.
Issue is not the Bindings, but HabPanel configurations. I lost all settings and panel. For this reason i need a setup.

Marco

I think I remember reading something about backing up Habpanel configs either on the great big Habpanel thread or the readme. All remember from it, and can’t find it quickly right now, was the settings are stored on your local machine unless you explicitly save it to the server. On the server it is saved somewhere in userdata.

I could be completely wrong of course but it might be worth asking @ysc directly.

Hi @rlkoshak
next time before to do an apt upgrade, I’ll perform a VMWare snapshot of OpenHab server, Then I’ll se whats happen.
Regarding HabPane, it save on local browser storage, or into OpenHab2 Variable, but I do not know for sure what it mean.
I did lot of apt Upgrade and never lost setting, except the last time. This is the main reason for I opened this post.

Thanks
for help.

Marco

same issue here. all settings ,bindings and addons are lost after apt upgrade, tested with offline and online version. Thats annoying.

It’s happened for the last few nightly builds that I have tried. The best method to alleviate this is to set up addons.cfg It takes all of 5 minutes to get it configured, and then after the apt-get upgrade you just have to wait a bit longer until all the addons are re/installed before the system is fully up and running.

I also find stopping the openHAB service before the upgrade helps, and then another restart after the install finishes. Dunno why, but I also clean out the logs while the service is stopped.

In a service configuration variable actually, retrieved and updated with the REST API. The backup/restore procedures of those are not clear to me.
If you have the Swagger UI installed for the API, you can retrieve it rather easily:
http://[your_server]:8080/doc/index.html#!/services/getConfiguration
The serviceId is org.openhab.ui.habpanel.

http://[your_server]:8080/doc/index.html#!/services/updateConfiguration will let you update it (just be careful)

That probably means it is stored in the system MapDB database which is located in userdata/mapdb.

I’m running in a Docker container with conf and userdata mounted into the container. Mine is set up to pull down the latest snapshot Image every time I restart the service. It has worked pretty awesomely well for me thus far.

Can someone clarify if this is intended behaviour or a bug?
Previously I installed bindings with PaperUI but didn’t add them to addons.cfg, and after an upgrade they were still there.

Ultimately this is the behavior we want. An upgrade should not wipe out your bindings and I’m pretty sure this is the direction the devs are heading.

I’m not sure I understand.
Previous releases did not wipe out the bindings.
The current release does.
So is that a bug that is being fixed?

I know in the meantime I can put entries in addons.cfg to get over it.
Just wanted to understand the direction.

I misunderstood your comment. I believe they are moving to where you shouldn’t have to reinstall bindings.

Sorry if I’m being dumb here, but we didn’t have to reinstall bindings just a couple of weeks ago.

1 Like