Migrating to new Pi

Newbie here. I have been experimenting with HA on a Pi 2b via etherner. Now I got a Pi 3b+ and I want to migrate the install and move to wifi.

I tried installing hassio image on the Pi3, running the initial setup, and then copying everything from config folder from the old to the new pi, but thats a disaster as I dont have the same modules installed. So I tried installing the same modules, but even after that, most things do not work and my log shows tons of sqlite errors.

Is there an easy way to do this? Or could I just use the Pi2 image on the Pi3 and then change the network settings ?

Use the snapshot feature.
On the old Pi instance, go into the hassio dashboard/snapshots, take a full snapshot and download it somewhere safe.
On the new Pi, run through the installer until you can access hassio. Install the Samba addon, upload the saved snapshot to the snapshots folder, go to hassio/snapshots (you may need to refresh), select the upload snapshot and do a full restore.

Bingo!

Gareth
PS come back if this was too terse. We were all newbies once!

1 Like

Thanks, I found and tried that meanwhile. The snapshot doesnt seem to include lovelace settings, node-red scripts, MQTT settings and a whole bunch of other things. But more importantly, Im getting database errors for just about everything. Like this one:

Error saving event: <Event state_changed[L]: entity_id=sensor.man_cave_temperature, old_state=<state sensor.man_cave_temperature=20.48; time=2019-11-25T12:25:30.577Z, setting=0, unit_of_measurement=°C, friendly_name=Man cave temperature, icon=mdi:thermometer @ 2019-11-25T12:25:35.086377+00:00>, new_state=<state sensor.man_cave_temperature=20.5; time=2019-11-25T12:27:25.247Z, setting=0, unit_of_measurement=°C, friendly_name=Man cave temperature, icon=mdi:thermometer @ 2019-11-25T12:27:39.309201+00:00>>
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/sqlalchemy/engine/base.py", line 1249, in _execute_context
    cursor, statement, parameters, context
  File "/usr/local/lib/python3.7/site-packages/sqlalchemy/engine/default.py", line 580, in do_execute
    cursor.execute(statement, parameters)
sqlite3.DatabaseError: database disk image is malformed

Addons should be captured by the snapshot.

The database on the other hand pretty much always needs to be deleted after a restore.

the addons themselves are restored, but their settings not afaict. How do I delete the database?

1 Like

If you are using the default database, stop home assistant, delete this file from your config directory:

home-assistant_v2.db .

Start home assistant and the file will be recreated.

That’s the correct way. In practice you can just delete the database and restart. I’ve never seen anyone have an issue doing it this way.

You will of course lose your history.

1 Like

thanks, that seems to have solved it.

After deleting the db, is it normal that the history charts are all messed up ~3 hours later?

Even if I set the range to 1 hour, the axis completely are wrong and entire lines are missing.

That is odd. Is there anything being reported in the Log?

Gareth

It was due to Brave browser. Specifically the shield that blocks “cross-site device recognition”.