Help migrating without recent backup

Hi All:
I’m trying to migrate my HassOS installation from an SD card to an SSD. All the information/YT videos I’ve seen are showing the process using backup/restore. Unfortunately, when I went to take a backup, it keeps failing with an “unknown Supervisor error” and there aren’t any errors in the Supervisor log. I tried from the command line as well and got a 404 Error. I do have backups but they are more than a year old. I’ve been simply taking tar files of config & .storage directories since they are NFS mounted on my desktop using Samba.

So, my question is, is there a way for me to install the latest Hassos on the SSD and then manually copy files from the existing SD card to the SSD to make it all work ? FWIW, my existing installation is 5.13 and the latest Hassos image I found yesterday is 9.3

I tried simply copying all partitions off the SD card onto the SSD but it wouldn’t boot after that as it couldn’t see the boot partition. gparted showed the partition table on the SD is a hybrid MBR/GPT one so not sure how the boot on that works. Even after I copied the 1st 2048 sectors from the SD to the SSD, it didn’t help as it then complained about a corrupted GPT.

Any advice/insight would be greatly appreciated.

OK, I ended up answering my own question :smiley: Here are the steps I followed in case anyone ever ends up in this situation. As I had an existing older backup (z9d47fe2.tar), I extracted the tar file contents into my local desktop. There were a bunch of tgz (tar.gz) files within the backup and a json file as well. Some of the tgz files were devoid of content because I didn’t have those add-ons enabled - media, share, ssl, etc. I checked their contents using gunzip -c <file.tar.gz> | tar tvf -. The backup.json file had some info related to the backup itself - name, size - and there was a section named “folders” that listed the above addons with empty tgz files.

Next, I copied my current HA config directory contents into a new directory called data and then made a new homeassistant.tar.gz file from it. Finally, I copied this new homeassistant.tar.gz file into my desktop where I had extracted the previous backup’s contents. Now, I removed the empty tgz files which then left me with some Samba, SSH, etc. tgzs and the homeassistant.tar.gz file. I modified backup.json and removed the deleted tgzs’ entries from the folders section in backup.json, leaving it blank. Lastly, I gave my backup a new name (z9d47fff) and modified the size by dividing the new size 34844156 with (1024 * 1024) to get the size in MB which gave me 33.2299 which rounded off to 2 decimals gave me 33.23.

Once this was all done, I created a new tar file (z9d47fff.tar) from the current contents and gave it the name I had entered in backup.json. I uploaded that to HA on my new SSD that had been upgraded to HAOS 9.33 and was successfully able to restore the backup.

> tar tvf z9d47fe2.tar
drwx------  0 root   root        0 Oct 07  2021 ./
-rw-r--r--  0 root   root      177 Oct 07  2021 ./addons_local.tar.gz
-rw-------  0 root   root      766 Oct 07  2021 ./backup.json
-rw-r--r--  0 root   root     1334 Oct 07  2021 ./core_configurator.tar.gz
-rw-r--r--  0 root   root     1419 Oct 07  2021 ./core_samba.tar.gz
-rw-r--r--  0 root   root     8203 Oct 07  2021 ./core_ssh.tar.gz
-rw-r--r--  0 root   root  8712309 Oct 07  2021 ./homeassistant.tar.gz
-rw-r--r--  0 root   root      169 Oct 07  2021 ./media.tar.gz
-rw-r--r--  0 root   root      169 Oct 07  2021 ./share.tar.gz
-rw-r--r--  0 root   root      168 Oct 07  2021 ./ssl.tar.gz

> mkdir ha_restore
> cd ha_restore
> tar xvf ../z9d47fe2.tar
x ./
x ./addons_local.tar.gz
x ./backup.json
x ./core_configurator.tar.gz
x ./core_samba.tar.gz
x ./core_ssh.tar.gz
x ./homeassistant.tar.gz
x ./media.tar.gz
x ./share.tar.gz
x ./ssl.tar.gz

> ls -ltr
-rw-r--r--  1 root  root     1419 Oct 07  2021 core_samba.tar.gz
-rw-r--r--  1 root  root     1334 Oct 07  2021 core_configurator.tar.gz
-rw-r--r--  1 root  root     8203 Oct 07  2021 core_ssh.tar.gz
-rw-r--r--  1 root  root  8712309 Oct 07  2021 homeassistant.tar.gz
-rw-r--r--  1 root  root      169 Oct 07  2021 share.tar.gz
-rw-r--r--  1 root  root      177 Oct 07  2021 addons_local.tar.gz
-rw-r--r--  1 root  root      168 Oct 07  2021 ssl.tar.gz
-rw-r--r--  1 root  root      169 Oct 07  2021 media.tar.gz
-rw-------  1 root  root      766 Oct 07  2021 backup.json

> cat backup.json
{
  "version": 2,
  "slug": "z9d47fe2",     <<<<<<<      Rename to new file name of backup
  "name": "HA_100721",    <<<<<<<      Rename to new name of backup
  "date": "2021-10-07T04:25:13.092266+00:00",
  "type": "full",
  "crypto": null,
  "folders": [
    "share",    <<<<<<<<<         Removed these 4 lines
    "addons/local",
    "ssl",
    "media"
  ],
 <<SNIP>>
  "homeassistant": {
    "version": "2021.5.1",
    "size": 8.31          <<<<<<<<       Calculate new size
  }
}


> rm  share.tar.gz ssl.tar.gz media.tar.gz addons_local.tar.gz

> cp /tmp/homeassistant.tar.gz .

> ls -ltr homeassistant.tar.gz
-rw-r--r--  1 root  root  34844156 Nov 23  2022 homeassistant.tar.gz

> vi backup.json

> cat backup.json
{
  "version": 2,
  "slug": "z9d47fff",
  "name": "Post_SSD_UPG",
  "date": "2021-10-07T04:25:13.092266+00:00",
  "type": "full",
  "crypto": null,
  "folders": [
  ],
 <<SNIP>>
  "homeassistant": {
    "version": "2021.5.1",
    "size": 33.23
  }
}

> ls -ltr
-rw-r--r--  1 root root     1419 Oct 07  2021 core_samba.tar.gz
-rw-r--r--  1 root root     1334 Oct 07  2021 core_configurator.tar.gz
-rw-r--r--  1 root root     8203 Oct 07  2021 core_ssh.tar.gz
-rw-r--r--  1 root  root  34844156 Nov 23  2022 homeassistant.tar.gz
-rw-------  1 root root      715 Nov 24 19:40 backup.json

> tar cvf ../z9d47fff.tar ./core_samba.tar.gz ./core_configurator.tar.gz ./core_ssh.tar.gz ./homeassistant.tar.gz ./backup.json
a ./core_samba.tar.gz
a ./core_configurator.tar.gz
a ./core_ssh.tar.gz
a ./homeassistant.tar.gz
a ./backup.json


> ls -ltr ../z9d47fff.tar
-rw-r--r--  1 root root  34860544 Nov 24 19:54 ../z9d47fff.tar