Migrating between Pis

Tags: #<Tag:0x00007f3f20655db8>

I currently have a significantly built out and configured HassOS based install running on a RPi 3B+ but I have found it lacking enough horsepower to run well even with only a few addons running on top. I recently picked up a RPi 4B 4GB and am looking to move my HassOS install to it. I have since discovered that simply cloning or moving the SD card doesn’t work (apparently there are some differences in the boot protocol between the versions of the Pi). I have also noticed that the HassOS version is 3.3 in the RPi 4 build and 2.12 in the RPi 3 build.

I have tried simply creating a snapshot and restoring it on the Pi 4 running a fresh install using the HassOS 3.3 build but it didn’t seem to copy any of my configuration over. Nor did it copy any of the addon data (e.g. No InfluxDB or InfluxDB data)

I have tried cloning the SD card from the original, putting the cloned card in another 3B+ and using the Import from USB option on a copy of the rauc file for 3.3 (This didn’t seem to do anything at all) the Pi 3B+ never switched to HassOS3.3.

I have tried copying over all of my configuration files, but this resulted in a whole lot of stuff not working, None of my side panels showed up for any of my addons (even after re-installing from the repos using the Store) and of course none of my addon data as there either.

Does anyone have a validated way (or even a decent idea on how) to move as completely as possible from a Pi 3B+ to a Pi4 in HassOS?

The snapshot method you describe should work. Based on addons not being transferred, it sounds like you didn’t check the box for full snapshot. I’ve used this method to move config and addons from a Pi to an x86 Ubuntu/Docker setup.

I am also struggling with moving from my old hassbian install on a PI 3 to a PI 4. I originally want to start with and new install using https://www.home-assistant.io/docs/installation/hassbian/installation/ then copying my .yaml files to the new system . Most things worked except for My Lyric T5 thermostat and Alexa_Media which apparently are not supported even with all the help from the forum. I finally did a image of my old SD card using Win32 Disk Image copying to my Windows machine then writing that .img to a new SD card. Everything seems to be working on my PI 4 with my old working system. Hope this helps.

Unfortunately since I am using HassOS instead of Hassbian this isn’t likely to help much. I already tried cloning the HassOS card from the Pi 3 but it wasn’t bootable in the Pi 4. There are apparently some boot protocol differences between the two that aren’t accounted for in HassOS 2.12 but are in HassOS 3.3. I haven’t found a way to upgrade my Pi 3 to HassOS 3.3 yet to test cloning at that point.

I suspect you managed to avoid this since Hassbian is possibly already up to speed with the Pi 4 boot sequence since it is Raspbian based.

I may have discovered why so little of the configuration was actually restored when trying to restore via snapshot. I have since attempted to take a couple more snapshots of my original Pi 3 setup and have been getting this error near the end of the process. I suspect this also happened during the first attempt but I didn’t notice it since I started the snapshot then went to work thus the log would have scrolled past.

So can anyone point me in the right direction for dealing with:

19-08-07 15:37:47 WARNING (SyncWorker_12) [hassio.snapshots.snapshot] Can't snapshot folder homeassistant: [Errno 2] No such file or directory: '/data/homeassistant/home-assistant_v2.db-shm'

Ok so the snapshot method did work once I had a good snapshot that didn’t throw the error mentioned in my previous reply.

The rough steps I used:

  1. On the old pi, stop all running addons. You don’t need to uninstall them though.
  2. Take a full snapshot, if you get the No such file or directory error, try again until you don’t get that (took 3 or 4 tries but the last one that worked for me is the first one I attempted with all addons shutdown)
  3. Download the successful snapshot file to your local computer (Note: The unsuccessful ones might still show up so make sure you get the one that didn’t have errors).
  4. Load the new pi with the proper hassos image for the architecture.
  5. Boot up the new pi and install an addon that will allow you to copy files to it (SSH, FTP, or Samba) and set it up. I used Samba but any should be fine.
  6. Copy the successful snapshot file to the new pi.
  7. Reboot the new pi. (Just for safety sake and it might help speed up recognition that the snapshot is there)
  8. Click on the snapshot file in the new Pi’s Hassio page and click restore.
  9. Select Wipe and restore
  10. Wait
  11. Wait some more
  12. Eventually the new pi will reboot with all your all settings in place. Login to make sure it is all kosher, halal, good, whatever. Some stuff might have errors if you haven’t moved Zwave radios etc. from old pi yet, this is ok.
  13. Shutdown old pi, move any hardware to the new one, then reboot the new pi one last time.
  14. Rejoice for you now have all of your stuff on a new pi with minimal fuss.

I only encountered a couple of problems after doing this.

  1. The HA database was corrupt so I deleted the db and shm files and rebooted since I didn’t care about the history there.
  2. My wireless settings didn’t properly transfer and I haven’t been able to get wireless working (I suspect HassOS 3.3 isn’t fully baked and might have a problem with the Pi 4B wireless chip that still needs ironing out). So I just wired it instead for now.