I like simplicity, but I have a slightly complicated cases with basically a combination of two scenarios that are each well covered in the documentation. But not both at the same time. Although I expect that this situation is applicable to more people.
Migration to a new platform, e.g. to a replacement Raspberry Pi, or from a Pi 4B to an Odroid N2+ (of HA Blue).
Using an SSD as a datadisk, but booting from a SD card or eMMC.
I have a HA OS installation on a Raspberry Pi 4B. I recently moved my HA storage from SD to SSD, using the āstandardā migration option Settings > System > Storage >
Move datadisk, keeping the SD to boot from. So for normal operation, I need both the SD and SSD.
I want to migrate from Raspberry Pi 4B to Odroid N2+, and take the SDD datadisk along. So the Odroid / HA OS should be configured to recognize the USB SSD in the first place (which was taken care of originally by the āMove datadiskā operation). I installed an HA OS image on the SD in the Odroid N2+. Then, there are two options:
I could start HA and restore a backup. But then it will be written do the SD by default (which is too small now for a full backup of the SSD on the Raspbarry Pi). And then start a āMove datadiskā to move the HA data and docker containers to the SSD (overwriting the data present there).
I could attach the SSD and configure HA OS (on the SSD of the Odroid 2N+) to use what is there on the SSD.
Iād prefer to use option 2, since that involves much less migration steps and retains all my backups and data. But is that possible somehow? There is no option āstart using existing datadiskā in the HA UI, so I suppose I need to configure something form the command line. However, with HA OS, the SSH command line is only available when HA is running with the SSH/shell component running. Isnāt it?
So Iām a but stuck how to proceed now. And I expect the answer to my question will help a significant number of others as well. The āmove datadiskā feature was a brilliant one, but a āuse existing datadiskā feature would complete it.
I hesitated a lot before upgrading. The main reason is that the manuals say I need to remove the existing partition from the datadisk before I can use it on the new configuration. So basically, there is no quick way back when something fails. I have to rely on the backup to be restored. But in the end, it did work out well.
Make sure you have an online storage for your full HA backups, in my case Nextcloud
Install Home Assistant on the new system (Odroid N2+) by creating a clean image on the SD
Perform a full update to the latest versions of HA-OS and HA
Install and test Nextcloud backup on the Odroid, so I can connect to my online backups
Make a full backup of the old HA system (in my case a Raspberry Pi); takes quite a while
Make a list / screenshot of all added integrations and custom components
In my case: make a backup of the deConz configuration (via the Phoson integration)
In my case: switch off AdGuard and restore the network routerās DNS settings to bypass AdGuard
Upload the full backup and (in my case) Zigbee backup to Nextcloud, an make sure the file transfer is complete
Retrieve the online backup to the new Odroid, but donāt restore yet.
Disconnect the old HA device
Restore the HA backup to the new device, but not for the additional integrations; that will be done later, after the Datadisk was configured, otherwise there could be not enough space in the SD card to restore everything
Adjust your HA netwerk address (so the MQTT server runs at the original IP address)
Now the basic functionality should be restored, and all your data is back there.
In my case: restore the deConz backup; it may seem that some Zigbee devices are missing, but eventually everything came back by itself.
Wipe the partition from your datadisk; I connected it to another Linux system and fixed it there
Migrate your data to the Datadisk, using the standard HA method for that from the GUI
After restarting, your disk space should show it was successfully migrated, and no longer using the SD card for HA, only for booting
Install all original add-ons on the new device; you can find the list when you open your original backup and choose for selective restore
After installing all add-ons, you can use the backup restore mechanism to selectively restore the data of each of those add-ons
Re-activate Adguard, and restore the DNS settings of your router
I hope I did not forget to list any steps.
My main issues were to wipe the Datadisk partition before I got the new system fully running, to skip restoring all add-ons before migrating to the Datadisk to avoid the SD card to run out of space, and to recover the Zigbee network configuration.
Bummer, I was really hoping thereād be a way to just point a clean install at the old data_disk and basically boot up as if nothing had changed. That feels like itād be a huge advantage of an external data-disk where the only thing on the sd card/boot disk is literally the OS.
I totally agree. I donāt see why Home Assistant would not be able to use a datadisk with an existing partition with data.
Although the backup-and-restore method worked out fine, but it took a lot of extra time, and felt like there is no backup plan it it fails and I want to restore the old hardware temporarily.