openHAB 4.3.2
I’ve used backup.sh
in QNAP and restore.sh
in Proxmox. openHAB seems to be working but I have these messages in the log:
2025-01-26 20:51:50.193 [WARN ] [org.apache.felix.fileinstall ] - /share/CACHEDEV3_DATA/.qpkg/OpenHab3/addons does not exist, please create it.
2025-01-26 20:51:50.200 [ERROR] [org.apache.felix.fileinstall ] - Cannot create folder /share/CACHEDEV3_DATA/.qpkg/OpenHab3/userdata/tmp/bundles. Is the folder write-protected?
2025-01-26 20:51:50.202 [ERROR] [org.apache.felix.configadmin ] - [org.osgi.service.cm.ManagedServiceFactory, id=50, bundle=18/mvn:org.apache.felix/org.apache.felix.fileinstall/3.7.4]: Unexpected problem updating configuration org.apache.felix.fileinstall.184eb3cb-cda7-443c-9bea-68186ab5bb5d
java.lang.RuntimeException: Cannot create folder: /share/CACHEDEV3_DATA/.qpkg/OpenHab3/userdata/tmp/bundles
Looks like OH is trying to access folders that existed in QNAP but no longer exist in Proxmox. What can I do to correct this ?
I don’t know about differences between QNAP and “common” openHAB, but please try
sudo systemctl stop openhab.service
sudo openhab-cli clean-cache
sudo openhab-cli reset-ownership
sudo systemctl start openhab.service
Thanks but had no effect.
Was QNAP also OH version 4.3.2?
Maybe you’ll have to do a manual restore (only essential files). This would be
unpack the backup file
There are some sub folders. As they apparently differ from qnap to standard openHAB, you’ll have to identify at least $OPENHAB_CONF
and $OPENHAB_USERDATA
.
The former is all stuff in /etc/openhab/
(standard openHAB…) and contains a structure of folders by-type, so ./items/
, ./things/
, ./rules/
, ./transform/
and so on…
If you never ever set up any config by text, you will maybe get away by ignoring this folder completely.
The latter is recognizable by a folder ./jsondb/
which contains the UI managed configuration and a subfolder ./backup/
, filled with (most likely) 5 copies of all the files in jsondb (history of the last 5 changes per file for manual rollback), so these files (without backup folder) are crucial to get openHAB restored.
Also, there is a subfolder ./etc/
in $OPENHAB_USERDATA
and another subfolder ./config/
. and finally, there might be a subfolder ./persistence/
Copy all those folders/files to use it later
At the new system, start with a newly installed openHAB, stop the server, copy the files to the correct folder, but… take a deeper look at the ./config/
folder, there may be files with absolute paths which have to be adapted.
Yes
This is the problem. How to correct them ? Maintaining absolute paths in config
means that openhab cannot be100% migrated accross platforms.
BTW, the folder structure in QNAP is equal to Windows. There is a main folder that has inside addons
, conf
, runtime
and userdata
. In debian the files are scattered in at least 5 separate folders (very confusing). From what I’ve seen so far:
- addons → /usr/share/openhab/addons
- conf → /etc/openhab
- userdata → /var/lib/openhab (but
logs
is not inside, instead it is at /var/log/openhab)
- runtime → part of its contents are in /usr/share/openhab/runtime, other parts I’ve not discovered yet
I also use the exec binding
so I had some absolute paths of my own, I accept that backup / restore tools cannot correct this, but absolute paths in config
should be corrected by the tools, don’t you think ?
As said in the 1st post, openHAB is running but I don’t know what are the future consequences of this absolute paths mismatch.
Edit - ipcamera is no longer making recordings, probably as a consequence
After changing dozens of .config
files I still have these warnings in the log:
2025-01-27 11:22:17.419 [WARN ] [.transport.servlet.ServletController] - Can't find the request for https://openhab-prd:8443/rest/events's Observer
2025-01-27 11:22:17.473 [WARN ] [.transport.servlet.ServletController] - Can't find the request for https://openhab-prd:8443/rest/addons/suggestions's Observer
2025-01-27 11:22:17.476 [WARN ] [.transport.servlet.ServletController] - Can't find the request for https://openhab-prd:8443/rest/services/org.openhab.i18n/config's Observer
2025-01-27 11:22:17.509 [WARN ] [.transport.servlet.ServletController] - Can't find the request for https://openhab-prd:8443/rest/addons/services's Observer
Also I have this other warning (but in QNAP I also had it):
2025-01-27 11:22:27.301 [WARN ] [mon.registry.AbstractManagedProvider] - Failed to create thing with UID 'http:url:60f460c81aiuy' from stored entity: Channel UID 'http:url:60f460c81a:switch' does not match thing UID 'http:url:60f460c81aiuy'
Edit; network.config
had the old IP, I was necessary to edit the file to correct (not available in the UI)
Well, that’s the structure of data from openHAB, and that’s true for all OS, including GNU/Linux.
No, it’s not (from GNU/Linux perspective), the real problem here is that you are not familiar with the “rules” for file storage locations (no pun intended!)
e.g. User profiles:
Windows: by default C:\Users\
, can be changed, but it’s not easy and there is absolutely no guarantee that all software will use the correct paths.
GNU/Linux: in most distros it’s /home/
. As I don’t know all distros
there may be some distros which may vary, e.g. QNAP may use another path?. But as ‘in unix everything is a file’, even /home/
is easily movable (without changing any configuration deep in kernel or initrd) to wherever you want it, how often you want it (offline, of course), and no software will even get aware of the move, as it’s file system. 
For services, Windows uses C:\ProgramData\
for “user data”, and in GNU/Linux it’s dependend on the user which runs the service, this may be a system user with a different path to its user data, other than /home/
(e.g. /var/lib/
)
And in question of the different folders “spread over the whole system”, in GNU/Linux
- temporary data should go to
/temp/
- log data should go to
/var/log/
- user data should go to
/home/
(keep in mind, that it’s the user openhab, which runs the software, this is a system user, so its home is placed in /var/lib/
by default)
- config data (the more static part) should go to
/etc/
- binaries and programs should go to
/usr/share/
or /usr/local/
, depending on the nature of software (afair self made software should go to /usr/local/
)
- variable data should go to
/var/lib/
and so on. You can deny to spread the data and keep it all in one directory (best practice would be /opt/
), but you will lose the benefits of the structured data, which are:
- different file systems for different data (backups…)
- better protection against data loss
- scalable partition size (maybe even on an up and running system)
- reduced write cycles through ram disks for temporary data
And I’m pretty sure that’s not half of the basic benefits.
So as openHAB was built with the clear intention to run on different systems, but as much as possible optimized, for sure at least some data is spread to its intended location.
2 Likes