Update old HA and switch from Core to Container

I am currently on an old (2022.12.7) HA ‘Core’ installation, in a Python venv on an ODROID-XU4, running Armbian.

I want to do as stated in the title. I became convinced that Container will be the better way for me, especially with fast development cycle of HA and newer Python versions they like to use (which seem to always be ahead of whatever – equally old – version of Debian I find myself on).

I have been researching, planning, and making notes about this for months (on and off) to the point I think I have analysis paralysis. I have so much anxiety about this it’s unreal.

I had come across a really nice article with fairly simple instructions about how to switch from Core to Container, but for all my note taking, I’ll be damned if I can find it now.

I was also wondering if I should step through each and every one of the many updates, or should I just install a new, parallel Container instance and restore a backup of my current config? The latter sounds (by far!) easiest. I was just wondering if that would automatically perform whatever database schema upgrades, etc. that were needed.

Other things which may be relevant:

  • I run mosquitto (MQTT broker) on a separate SBC on the LAN. Therefore I don’t think I need to do anything here.
  • I installed Z2M in a (separate) venv on the same ODROID-XU4. Therefore I also assume I won’t need to do anything here, either.
  • ???

Any thoughts / advice will be greatly welcomed, while I continue to try and find that article…

EDIT:

I found the article!

HA venv to Docker

Any other advice is still appreciated. I guess I was still wondering about the DB schema (or other intermediate) update(s). Maybe I should just make a backup, move that somewhere safe, and give it a try…

Lots of breaking changes since 2022.2 . Definitely step through first release of each month. You could probably look through breaking changes in releases and simply jump to version before a breaking change apply to your install >> backup >> upgrade >> apply breaking change > backup >> upgrade . By doing this you can probably skip 6 month releases as you step through updates. I can only think of maybe 2 breaking changes affecting my install in past 2 yr, not including the db migrations.

As long as you backup it should be easy. I wouldn’t use UI backup but since it’s docker I would instead use rsync to copy config folder to new folder, keeping copy for each upgrade. This allows rollback at any point if issue is found. Once you are on latest version and all verified working, you can clean up folders and delete unneeded.

Yes, for example

If V1 >> V2 require db migration it will happen automatically. If v2 >> V3 require migration it will be done. I do NOT recommend V1 >> V3 jump. I am not sure this works and would not try.

Should work without issue

Maybe an issue with networking. Both in docker may be easier long term

MacVLAN is best for HA in docker. Most use host networking but Macvlan has similar function with more flexibility.

Dont use latest tag. Use specificed version. HA has 3-4 release a month and you want to know exactly what you’re using. For things like mosquitto or Mariadb I use latest since they have less releases and generally less config to setup from default

1 Like

I pressed enter on command docker-compose up -d homeassistant literally moments before your reply popped up. :smiley:

Don’t worry, before doing that, I:

  • made backup from within UI
  • copied entire .homeassistant folder (including above backup) to another device for safekeeping
  • stopped the venv

Therefore, in case of disaster, I should be able to start all over. But I decided to follow the “here, hold my beer” school of sysadmin, and just go for it. :smiley:

Currently, I am watching logs (in both Docker as well as UI). Home Assistant seems to have come right back up, as far as I can tell.

In UI logs I see:

Database is about to upgrade from schema version: 30 to: 43

And then, a little later:

Upgrade to version 39 done
Upgrade to version 40 done
Upgrade to version 41 done
Upgrade to version 42 done
Upgrade to version 43 done

So, maybe it did work?

1 Like

In addition to checking logs, I have now gone around the house checking things against the UI, and all seems to be running OK (so far)!

The new ‘Assist’ functionality (in Android app, even using only text) is quite impressive!

I have (almost) gone from anxiety to excitement. It will take me (at least) a few more days before I let myself really get excited, though. :smiley:

Yeah, both official docs and Tinkerer’s guide specified stable image. I am not sure how that differs from ‘latest’, in fact I had asked about that some time ago.

I specify specific Debian versions (e.g., ‘Bookworm’ instead of ‘Stable’) for same reasons.

I am still learning Docker, but my initial assumption is that it will only upgrade when you do a docker pull? Actually, I need to look this up (among other things)…