Clean install of OH 2.2 with rollback scenario to 2.1

  • Platform information:
    • Hardware: Intel NUC
    • OS: Ubuntu 16.04 LTS
    • openHAB version: 2.1

Hi,
I currently running Openhab 2.1 on a Ubuntu 16.04 lts server.
I upgraded from OH 2.x until 2.1
it’s running , but it’s polluted.
So I want to do a clean install of 2.2
I’m looking for the most simple way of doing that (retaining most of my rules and items) whit a rollback scenario to the current situation (OH 2.1)
Currently OH is installed with the apt get install method
I’m not on a virtual machine, so I can not make a snap shot!
I don’t know how to make a backup or image with in Linux (Ubuntu Server)

What if I stop openhab en rename al the folder and do a clean install via apt get?
Is that a option??
Any other ideas (quick and dirty :wink: ) is what I’m looking for.

I’ve not tested this. Proceed at your own risk.

Create a backup of /var/lib/openhab2.

Create a backup of /etc/openhab2.

Delete both folders.

Completely remove OH with a sudo apt-get purge openhab2

Do a fresh install following the instructions in the docs.

At this point, you can copy your /etc/openhab2 backup over which will restore your text based configs. You will then need to install your bindings and rediscover your Things and recreate your Items that are managed by PaperUI.

To roll back, repeat the process above only install the 2.1 version after the purge. Then stop OH and restore both the /etc/openhab2 and /var/lib/openhab2 folders.

I think that will work.

1 Like

Sounds about right.

When you restore your configuration be sure to (1) stop openHAB beforehand and (2) correct the file permissions! Both things done wrong could create issues. Also I’d suggest to only restore from /var/lib/openhab2 what you really need. There the most “pollution” will be, if any exists…

Thanks guys, that are really useful tips.

I want to do a clean installation instead of an upgrade because I want to get rid of all unnecessary junk.
in this way I am quicker up and running again.
I’m going to take the plunge

Thanks so far.

Oh yeah, question: if I do a clean install via “apt-get install”, is openhab runnig as the user “openhab” by default?

Yes

You can change that if you want (why would you? :)) by modifying /etc/defaults/openhab2 file

I just reinstalled openhab.
“openhab” is indeed the standard user and that’s okay.
That’s what I wanted it, thanks for your answer

Now I’m going to install the bindings i need and configure everything with the help of my backup files.