Upgrading OpenHABian: Bullseye to Bookworm with OpenHAB Milestone -> Stable Branch Change

Hi,

If this post actually belongs in the “Installation” category, I apologize and ask that it be moved.

I’m planning to upgrade my OpenHABian from Bullseye to Bookworm using a fresh install (as dist-upgrade is not recommended). Additionally, I want to switch from OpenHAB Milestone(which I switched to in order to be able to use a device) to the stable branch during this process.

Current System:

  • OpenHABian (Debian Bullseye)

  • OpenHAB (Milestone build)

  • Zigbee2MQTT

  • Daily Amanda backups (using Samba shares)

  • MQTT broker runs on a separate machine

Upgrade Plan:

  1. Fresh install of OpenHABian Bookworm

  2. Before the fresh install, backup:


# Creates full OpenHAB backup including configurations, userdata, persistence in /var/lib/openhab/backups/

sudo openhab-cli backup

# Zigbee2MQTT data

sudo tar -czf zigbee2mqtt.tar.gz /opt/zigbee2mqtt/data

# System configs needed for Amanda

sudo tar -czf configs.tar.gz \

/etc/samba \

/etc/network \

/etc/hostname \

/etc/hosts \

/etc/fstab

Questions:

  1. How do I properly switch from Milestone to stable branch during the upgrade?

  2. Are there any known incompatibilities when restoring an openHAB backup from a Milestone system to stable?

  3. What’s the correct order to restore components after the fresh install, considering the branch change?

  4. How do I ensure my Amanda backup system works correctly after the upgrade?

  5. How do I make sure that I haven’t forgotten a service or something similar?

Thanks for any advice!

When you first set up openHABian I believe one of the things you can put into a text file in the boot partition is the repo you want to install OH from. Choose release. Details should be in the openHABian docs. You should be able to put your backup file there too and openHABian will do the restore as part of the initial installation and configuration.

Right now the release and milestone is exactly the same so now a good time to do it.

Until the first milestone for OH 5 is released, they are identical. So at least through January there will be no problems.

I don’t think order matters.

I can’t answer that.

I guess notice that something isn’t working.

I backed things up and installed the whole thing on my backup hardware.

I did:

sudo openhab-cli backup --full backup.zip

And on the new system I did

sudo openhab-cli restore backup.zip

and get this message:

Restore needs a valid backup file to continue.
  e.g. 'sudo openhab-cli restore backup.zip'

Is there a way to validate the file?

Oh, no please. Do not EVER forward old configuration files to your new OS.
Setup Amanda, Samba etc. from scratch.
Use the new system’s defaults and adapt if needed.

Okay, good to know. :sweat_smile:
But the openHAB backup doesn’t fall into this category, does it?

No, but both OH instances should be having the same version.
So make sure you upgrade to latest OH on your old box before you export its config

I did an “Update System” within openhabian-config which also does an “Install openHAB” but I did that too just to make sure.
Checked again right now:

Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
openhab-addons is already the newest version (4.3.0-1).
openhab is already the newest version (4.3.0-1).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
OK

I installed openhabian with Raspberry Pi Imager.
When I try to restore I get the error from above.

Make sure you are running this command from the folder where backup.zip is located or use the full path to the file on your command.

The file is a zip file so you can open it up and see what it looks like. zip -T backup.zip will test the entegrity of the zip file. unzxip -l backup.zip will list all the files in the zip without extracting everything. You should see most of what’s in /var/lib/openhab and /etc/openhab in that file.

It was indeed the missing path. I was in the right directory, but forgot the “./”.

Thank you!

And also thanks for the hint that I should not copy the configuration. I’ll move it gradually when the Z-Wave controller is up and running.