Whats your way to update OH2 with another nightly build?

I tend to use new nightlys often.
But I think my manual update procedure is too complicated.

Is there a best way? Or even update routine?


1 Like

Did you see this? It’s a bit out of date, but maybe a good starting point (I tend to update my update script (1st Script) but it’s work in progress and I don’t have enough time at the moment.

Same for me here. I download the nightly buildings from cloudbees every 48h, save my addons and conf folders an start from the scratch with configuration of all things in the inbox & assign it to my items.

Maybe there is an easy way to save the configuration & the assigned items?!?

These are the lines of my script that guarantee a fresh download:

rm -rf $HAB/runtime
rm -r $HAB/userdata/cache/*
rm -r $HAB/userdata/tmp/*

unzip -n $DOWN/openhab-online-2.0.0-SNAPSHOT.zip

If you only remove these, you will only clear out the maven cache, forcing a fresh download at startup. You don’t need to axe your configurations (mapdb, etc).

Hope this helps


Hi xsnrg!
So you already have a script that does that for you? And just to know, which steps do you need to perform manually? And, if you don’t mind, could you post your script?


No problem, it can always be found here:


Please be sure to read the comments.


Hi Jim!
Thank you very much!

hey @xsnrg it does wipe the bindings. you reinstall them all again to get the latest?

Correct. It forces the repo to resync. If you put the binding you use in the addons.cfg it should do it for you.

ahh makes sense. perfect !

Thanks @xsnrg for the script. I seem to be losing my persistence data with this (though the files are still present in the /userdata/persistence folder). Is this expected behaviour? Is there any way to keep the persistence data intact?

Your persistence data is maintained, though it may not be available right away. One word of caution when using this script, after the first time you start up again after the upgrade, all of the maven dependencies are gone and have to be downloaded again. Give it some time, more so on a slow device like a Pi. This also has a tendency to throw some exceptions until all the dependencies and bindings are loaded again. After the log output has stabilized, it may be a good idea to restart, and it should then come up quicker and cleanly.

Thanks and that’s good to know. I’ll restart the service and see if the persistence data comes back.

1 Like

Does anyone have a recommended process for updating a Windows installation of OH2 to the latest nightly build?

It is just that I did an update last weekend and then had to rediscover all of my z-wave things and then redo all the links. I really don’t want to repeat that process very time I update the system.


I have not written a batch file or powershell, but you should be able to follow what I did with the bash script, and perform the same steps in windows.

Basically, download the bundle you need, remove everything under the runtime folder, remove all the cache and tmp data under the userdata maven folder (don’t touch the mapdb or anything else, that is where all your configuration is!), then extract the newly downloaded bundle over the top of what is left.

Again, the important stuff for your individual configuration resides in the userdata folder, be careful in there to only remove things in tmp or maven cache folders.

1 Like

Thank you for your reply and advice. I will also make sure I do a full backup as well before I do anything.


OK, so I tried the following process to update OH2.

(Environment = WIN7 64 Bit)

Firstly after stopping OH2 I made a copy of the full directory structure c:\openhab

Then I did the following…

  1. deleted the folder c:\openhab\runtime and its contents

  2. deleted the contents of c:\openhab\userdata\cache\

  3. deleted the contents of c:\openhab\userdata\tmp\

  4. extracted the latest (as of today) snapshot to c:\openhab

  5. copied new copies of the latest zwave and Mqtt bindings into c:\openhab\addons

  6. started openhab

  7. using paper UI reinstalled the mqtt & zwave bindings

  8. reset sitemap settings for classic and basic UI’s in the paper UI.

Ok, so after this I was able to confirm that my items and sitemap were still in place. Also MQTT was working.

However, I then seemed have a problem with all of my zwave devices (devices and links were lost). I was trying to get them back using HABmin2 ver 0.1.4 and getting really unreliable results. I was able to restore a couple of devices but zwave looked to be broken as these devices did not work after linking…

Question: with the recent changes to OH2 and the bindings, does HABmin need some changes also?

Anyway, I have now reverted to to my backup copy so that I can get on with development of my home system.

If anyone has any ideas re: what I may have done wrong or missed, then I am happy to repeat the process, given I now have a quick way to revert to my working version of OH2.

I look forward to your comments.


Why did you do 5) and 7)? As I understand, doing 7) will always get you the latest version from the bin repo.

re: 5) because I saw that there were some changes over the last couple of days to the bindings

re: 7) because when I went into the Paper UI, after restarting, the bindings were showing as “uninstalled”

FYI, I extracted the “offline” snapshot. Also, I am not sure that it does get the latest version from the bin repo for v1.9 bindings. I could be wrong, but it has not seemed to work for me yet.


The current version of the z-wave binding is not working. It will likely be fixed with tonight’s build.

As for steps 5 and 7, in the conf directory there is a file called addons.cfg. Edit this file and add the bindings you always want to use to it. In this way, when you remove the cache directory contents, OH2 will be forced to download the latest bindings that you specified. You should not have to do any manual downloads for any 1.x or 2.0 bindings to get the latest ones. Let the system do the work. If you use the offline version, then just use PaperUI, no need to manually copy. You will have all the latest bindings as of the last time they were built.