I have been running OH 3.0 RC 2 on Windows 10 for the last couple of days with out any problem and was able to create a new data base from scratch.
Today I tried to make the necessary changes in order to run OH as a service.
I followed the instructions in the new documentation about running OH 3 as a service and upon restarting OH was loaded and running as expected.
However when I tried to open the web side on the localhost I was presented with the dialogue for creating a new administrator and a brand new data base was created from scratch with out any entries in it.
I copied back the complete openhab directory from backup and I regained my old data base with all entries but off course without the ability to start as a service.
I repeated the instructions on the new documentation for a second time and again had the same result. The service started but with a completely new data base.
Thanks for the reply Rich. Always value your posts.
Unfortunately OPEN_HOME seems not to be the problem. Checked it again and again .
It is pointing to C:\openHAB which is the correct OH directory.
set.default.OPENHAB_HOME=C:\openHAB
Can it be some other entry in wrapper.conf ?
I checked the userdata/jsondb folder and the correct data files are still there. So it must be some kind of a pointer showing in the wrong direction.
Maybe necessary to clean a cache or something.?
The problem remains even after several restarts.
No, if it’s different when you run it using start.bat from when you run it as a service, the problem is in that service wrapper config somewhere. I can’t say how or where the problem is though. Just that, based on appearances, it’s getting the paths wrong.
Clearing the cache won’t do anything for this. All that really does if force a reinstallation of the addons.
Investigating this problem further I have found that when the openHAB service is started for the first time it creates a second userdata directory within the original userdata containing empty jsondb files… i.e
C:\openhab\userdata\userdata\jsondb
This is the reason that when starting the runtime as a service is asking for the creation of a new data base even though there is an existing database in C:\openhab\userdata\jsondb.
Deleting this additional directory and starting the service will create the additional directory again.
I went through the openHAB-wrapper.conf file and the C:\openhab\userdata\bin\openHAB-service.bat file but I cannot find anything wrong that could cause such a behavior.
A walk around to solve this problem is to copy the contents of the original C:\openhab\userdata\jsondb directory into C:\openhab\userdata\userdata\jsondb in which case the service is working properly but off course this is not a good solution since in such a case, starting the runtime using the start.bat batch file will access the wrong data base located in C:\openhab\userdata\jsondb.
Any advice as to the cause of this problem will be greatly appreciated.