Migrate from openhabian buster release (OH 3.0) to os bullseye release and current OH release 3.3

Hi all,

I have a problem I need to solve. My current openhab is on a rather old release and I need to update it. on the one hand updating/upgrading the operating system turned out to be a problem as the repos are not anymore where they should be. Then the main release of the os is not supported anymore in terms of security patches as far as I understood. So I understand I need to update to the os release “bullseye” in order to be on the safe side.
Is I have understood by reading other forum entries upgrading the main version of the raspbian os is not something trivial to do and needs thorough knowledge of linux. It was recommended to to a fresh install of openhabian from scratch as this is much safer.
Doing that, however, would make it necessary for me to backup everything I have configured so far. I have done all configurations using the UI of openhab, so I understand there are no config files I can just copy in order to save my work and settings. On to of that I have installed some add-ons like a database, zigbee2mqtt, mosquitto, script engines and so on. I am VERY happy that I got all this running and don’t want to lose it, especially not all the data in my database.

My question is: How can I go about it? I made a copy of my ssd image, so I can restore most of it by restoring the ssd (which I could not test as I don’t have a separate ssd handy. :frowning:

So far I understand I need to do the following:

Backup all things, items, channels, scripts and settings in openhab (done by backup function of openhab as I understand)
Backup my apple watch site file (not done in the UI)
Backup the DB I am running to collect all measurements of things
Backup my zigbee2mqtt settings
Backup my mosquitto settings

Can anyone tell me whether I am following the right path here? Am I missing something? (I know you don’t know what I am using if I don’t tell you, but maybe you go like “Don’t forget to do this and that, as many people do that!”. Any advice is much appreciated.

Maybe there is even a better way of tackling this? Or maybe even a good central place to read about backing up and restoring? I am happy to read myself, but I’d like to make sure the stuff I read is actually the stuff I need.

All the best


What I am normally doing when upgrading the OS from one to the other major version ( mostly not an inline upgrade but a new installation of the OS ) is that I tar the /etc tree so that I have the possibility to have a look to earlier configurations. Besides that I create a list of all installed packages ( just in case something I forgot to install ). This is is created by doing dpkg -l on a Debian system.
Some software stores stuff under /var like OH does ( /var/lib/openhab ) - this is what openhab-cli backup deals with.

This is incorrect. It’s just the files to copy are somewhere else. In this case, as @Wolfgang_S points out, in the userdata folder.

There are other stuff from that folder that needs to be saved too so even if you only use text file config you’d want to get that folder too.

That’s why openhab-cli backup exists. Use that to backup and restore and no matter how the config was made it will be captured.

The gotcha in this case is that you need to restore to the same version of OH you are coming from, not the latest.

openhab-cli does not handle theses. You’ll have to look at those program’s did for your to backup and restore them.

If this is part of OH configs, I’ll be captured by openhab-cli.

You could try to do an Insitu upgrade and see what happens. a there are instructions on the Raspberry Pi forums. You’ll need to go one is version at a time though (e.g, if you are on jessy you’ll need to upgrade to stretch first before moving to buster and finally bullseye.

You really only need to know apt, when this works. However if it doesn’t work than yes, you’ll need to know Linux internals to fix it. But if it works it’s pretty smooth. So you could try the in place upgrade and if it falls restore your backup and try the start from scratch approach if it doesn’t work.

If you are running openHABian, it should have fixed the oh repo change for you. If it falls or you are not, you can fix the repo by hand to upgrade OH. That might be worth doing first so that your config backups will import to the new OH on the rebuilt system. Even with the Insitu upgrades of the OS, it’ll help to deal with OH separately.

Note: Tutorials and Solution is a place to post tutorials, not a place to ask for them.

So you’re running openhabian off an SSD ?
That’s not supported as explicitly but not exclusively mentioned here.
This section of the official docs is also where you’re asked NOT to ask for help if you despite of the warnings nonetheless use an SSD and run into trouble with your system.
Frankly, my pity is quite limited here as the inability to make proper use of openhabian builtin backup/restore functionality is right one of the reasons we don’t support SSDs (but not the only one).

This topic was automatically closed 41 days after the last reply. New replies are no longer allowed.