Moving an existing installation from sd card to usb boot

I’m running Openhab (Openhabian) since weeks on my Pi 3b from a sd card.

Due to more reliability, I bought an Renkforce USB to MATA adapter and a 32 GB MSATA.

My question is: Can I silmpy clone my sd card (with Raspibackup) and write the image to the mstat drive and restart my PI (with activated USB boot)?
Anything else that I have to take into account?


I did something similar a while back except I didn’t clone the SD card. I made a backup using sudo openhab-cli backup --full then moved the zipped file to my PC. The backup will be stored at var/lib/openhab2/backups. Next I used Etcher to install a fresh openhabian image on an SSD drive. Note, you will need to click the gear icon on the top right corner and enable danger mode to allow Etcher to write to something other than a USB or SD card.

After you have the new image installed and OH running on the RPI you can restore the backup by placing the zipped file in var/lib/openhab2/backups. Then use the following commands:

sudo systemctl stop openhab2

sudo openhab-cli restore /var/lib/openhab2/backups

sudo systemctl start openhab2

If you prefer to clone the SD card here is a great guide that works will Windows, Mac and Linux.

What you describe is more or less a new installation of openhabian.
But my main question is: is it possible to clone my sd card to an usb decive (with openhabian)?

It’s a new image install but using the backup and restore will retain your OH setup. Give it a try, worst case you still have OH on the SD card and you can backup and punt from there.

I could be wrong but I don’t think openhabian can clone it’s self.

As i understood right - this way will not copy to new disk for example mqtt broker, zigbee2mqtt service and other services that could also be in system, but only openhab or am i wrong?

This way, the information about installed addons is backuped, but not the addons itself, so when installing openhab2 new, the actual version of the bindings will be installed.
The only things to backup in addition, are the manually installed addons e.g. addons you installed in /etc/openhab2/services/addons. You may have to reinstall any jar files that you’ve installed as well.

Also not sure about zigbee2mqtt getting copied so you may want to make a separate backup for that (see step 6 here for making backing up).

Cloning the SD card may also work but I’ve only tried this when moving from SD card to another SD card. If you want to try it here’s the directions that worked for me.