Migrate HA OS installation including SSD datadisk

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.

  1. Migration to a new platform, e.g. to a replacement Raspberry Pi, or from a Pi 4B to an Odroid N2+ (of HA Blue).
  2. Using an SSD as a datadisk, but booting from a SD card or eMMC.

Both are covered on Common Tasks - Operating System - Home Assistant, but Iā€™m still not sure what to do when both apply at the same time.

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:

  1. 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).
  2. 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.

Did you have any luck figuring this out? Iā€™m in a similar situation.

1 Like

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.

  1. Make sure you have an online storage for your full HA backups, in my case Nextcloud
  2. Install Home Assistant on the new system (Odroid N2+) by creating a clean image on the SD
  3. Perform a full update to the latest versions of HA-OS and HA
  4. Install and test Nextcloud backup on the Odroid, so I can connect to my online backups
  5. Make a full backup of the old HA system (in my case a Raspberry Pi); takes quite a while
  6. Make a list / screenshot of all added integrations and custom components
  7. In my case: make a backup of the deConz configuration (via the Phoson integration)
  8. In my case: switch off AdGuard and restore the network routerā€™s DNS settings to bypass AdGuard
  9. Upload the full backup and (in my case) Zigbee backup to Nextcloud, an make sure the file transfer is complete
  10. Retrieve the online backup to the new Odroid, but donā€™t restore yet.
  11. Disconnect the old HA device
  12. 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
  13. Adjust your HA netwerk address (so the MQTT server runs at the original IP address)
  14. Now the basic functionality should be restored, and all your data is back there.
  15. In my case: restore the deConz backup; it may seem that some Zigbee devices are missing, but eventually everything came back by itself.
  16. Wipe the partition from your datadisk; I connected it to another Linux system and fixed it there
  17. Migrate your data to the Datadisk, using the standard HA method for that from the GUI
  18. After restarting, your disk space should show it was successfully migrated, and no longer using the SD card for HA, only for booting
  19. 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
  20. After installing all add-ons, you can use the backup restore mechanism to selectively restore the data of each of those add-ons
  21. 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.

Any work around to reuse the Data disk as is, instead of doing a full backup and restore of the whole data?