Need To Migrate Everything To New SD Card Running Hass.io

Hello everyone!

I believe the SD card in my RPi running Hass.io is dying so I need to migrate everything over to a new SD card running a new install of Hass.io. Unfortunately every time I try to create a Snapshot it fails so there’s no way I can import a Snapshot to the new Hass.io install. Is it possible to just copy the config files over and have all my Zwave devices, automations and other settings work with the new install of Hass.io? If so, what directories and files should I copy over?

Here is my current setup:

core-ssh:/config# hassio info
arch: armv7
channel: stable
hassos: "2.12"
homeassistant: 0.103.0
hostname: hassio
logging: info
machine: raspberrypi3
supervisor: "195"
supported_arch:
- armv7
- armhf
timezone: America/New_York

You have a couple of options. You can copy the /config directory. As long as you also include the /config/.storage directory (hidden), then you should be ok.

You can also clone the SD card. There may be a way to do this on a Windows machine, but here is how to do it on a Mac or Linux based system/VM using the DD command. Your syntax will be something like what I spelled out here: Best way to replace the SD card?

1 Like

What makes you think the sd card is dying? Is it because snapshots fail?

Copying config files will get most of it working, but if you are using any addons then you’d be missing some things. I would first check that the SD card isn’t just too full to do a snapshot. Sometimes your homeassistant_v2.db file can grow huge and cause problems… or if you aren’t in the habit of deleting snapshots from your instance. Both of those issues are very easy to fix.

1 Like

I was trying to avoid DD’ing just in case a Hass.io database/file system was corrupted and/or the SD card is dying. I scp’d everything to the new Hass.io install and at first all my Zwave devices were missing the metadata (it was a mess). I started with a new Hass.io install, removed the Aeotec-Z-Stick and only scp’d these files over to the new install:

core.config_entries
core.device_registry
core.entity_registry
automations.yaml
configuration.yaml
groups.yaml
zwcfg_0xf72d953d.xml
zwscene.xml
options.xml

According to this the pyozw.sqlite would be recreated so I omitted copying it over to avoid any further problems.

Everything has been working great! I can create full snapshots from the web UI, the SSH server and Configurator Add-ons are no longer crashing, and there’s no delay turning my Zwave devices on and off.

Thanks for the help!

2 Likes

I thought the SD card was dying or something was corrupted because of weird anomalies I was experiencing. Yes, the inability to create snapshots from the web UI or CLI was part of it. For example, the SSH Server and Configurator add-ons would crash sometimes once or every other day. Executing a reboot from the web UI or hassio host reboot would fail. It would require me to power cycle the RPi each time. Also, Zwave devices had high latency when switching on and off. The SD card was not full either. I posted about this in another thread:

Cannot Upgrade HA From 0.103.0 to 0.103.5