Hey,
I was faced with the task of updating my setup to OH5. I was on a Raspberry Pi with 32 bit and therefore first had to convert the system to 64 bit.
For me, as someone with no real knowledge of Linux, looking for the individual commands wasn’t exactly easy. So I’ll summarize it now for anyone who might feel the same way as me.
Before you start with your system, prepare a new(!) SD Card with the latest openhabian for Pi 64bit.
Make sure your Pi is at least a model 4 with 2GB RAM or (better) more.
Download the Raspberry Pi Imager here
Select your model
Select the OS. “Other specific-purpose OS” / “Home assistants and home Automation” / “openHAB” / “openHABian (64 bit)”
Select your SD Card and let it write the file.
In the meantime prepare the running system.
First step is to backup the config with the build in backup tool.
Log in via ssh. On windows you can use the cmd with this command:
ssh openhabian@yourIP
pwd: openhabian
I use a NAS as location for the backup so it is stored not on the SD. Alternatively you can copy the backup file via a networkshared folder.Then skip this part.
This is how I mounted my NAS as a folder.
First create a directory where your NAS will be mounted:
sudo mkdir /var/FOLDER
After that mount the folder:
sudo mount -o username=USER,password=‘YOURPW’ ``//Your.NAS.IP.ADDRESS/FolderNAS`` /var/FOLDER
Backup the config like this:
sudo openhab-cli backup /var/FOLDER/FolderNAS/backup.zip
After that I would recommend to update the system via openhabian-config the to the latest version. In my case it was 4.3.5
sudo openhabian-config
If this was successfull and everything is working as expected, make a backup again.
sudo openhab-cli backup /var/FOLDER/FolderNAS/backup_2.zip
Now stop the openhab Service with:
sudo systemctl stop openhab.service
And shutdown the system with
sudo shutdown
After the system is down, remove the SD Card and keep it. If the update won’t work you still got your working OH4 setup on this SD.
Now insert the new sd, after it was successfully written by the Pi imager, into your Pi and power it up.
Wait for about 15min.
Connect to your Pi via ssh like before.
If the Pi uses the same IP like it did before, there will be a warning when you try to connect via ssh because the shh keys changed.
Delete the old key in the file
DRIVE:\Users\YOURUSER.ssh\known_hosts
and connect again.
Now we need to roll back the version so it will match our old 32 bit installation.
Check the available versions:
apt-cache showpkg openhab
Now use the version your 32bit system was updated to. E.g 4.3.5
sudo apt-get install openhab=4.3.5-1 openhab-addons=4.3.5-1
After this was done you got a 64bit system with the same version as your 32bit system.
Now restore the backup:
sudo openhab-cli restore /var/FOLDER/FolderNAS/backup_2.zip
Confirm the restore with yes.
Now the system should be running the same like it did with the other 32bit SD card.
If yes you can now finally update to the latest OH5 Version with the
sudo openhabian-config
If openHab won’t be running, start the service with
sudo systemctl start openhab.service
Hopefully this will help someone. I wish I have had something like this.. haha.
Best regards
Dirk