MQTT broken after emergency migration to Docker

Hi all, so I had Home assistant 0.115.6 (patched up with the latest security stuff) running on my Raspberry Pi in a venv (no docker). Made some mistakes today and broke the Pi, but beforehand I had the presence of mind to backup all of the files from the homeassistant directory. So, I spun up a Docker image of homeassistant, and pointed its /config volume to a folder with all the data from the old Pi instance. However, things don’t quite look great.

  1. First, when I opened the web UI, it asked me to create a user and tell it where “Home” was again. I figured that was not a good sign.
  2. I found that many of my entities are still there, but all of the integrations were lost, including MQTT. My Automations, however, are still intact, but they were all enabled (I had previously disabled some of them).
  3. I manually installed the MQTT integration and set it up, but it doesn’t actually work. When I look at the logs, I see a KeyError related to mqtt:

home-assistant | Traceback (most recent call last):
home-assistant | File “/usr/src/homeassistant/homeassistant/components/websocket_api/decorators.py”, line 18, in _handle_async_response
home-assistant | await func(hass, connection, msg)
home-assistant | File “/usr/src/homeassistant/homeassistant/components/mqtt/init.py”, line 1478, in websocket_subscribe
home-assistant | connection.subscriptions[msg[“id”]] = await async_subscribe(
home-assistant | File “/usr/src/homeassistant/homeassistant/components/mqtt/init.py”, line 441, in async_subscribe
home-assistant | async_remove = await hass.data[DATA_MQTT].async_subscribe(
home-assistant | KeyError: ‘mqtt’

I did not know that I could create a “snapshot” of the system before, and it’s too late to do that now. Is there anything I can do to recreate HA the way I had it before? At this point I might as well build it up from scratch or move to another platform otherwise.

Did you use the „latest“ Docker image (2021.1.5) or 0.115.x? My guess is that so many breaking changes from 0.115 to current make it impossible to use your old configuration.

Start with migrating to .116. .117, .118 and then latest, reading release notes and fixing breaking changes.

Good point. Interestingly I think it is closer to working now; I had file permissions issues. I copied all the old files over again, but then changed their ownership to “root”, then rebuilt the Docker container and now at least MQTT and all the other entities are there.

My only remaining gripes are 1) I lost my dashboards (does Lovelace store those in a different directory?), and I lost both of my weather integrations (NWS and OWM).

OK, went through the steps to ‘take control’ of the dashboard, then I copied the old HA install’s lovelace file over to the new one; restart homeassistant, and voila - got my dashboards back!

Then I just manually re-added my integrations.