Upgrade Stragegy

I am looking for some feedback on what my upgrade strategy should be with Hassio and Home Assistant. I have been running Hassio/Home assistant for almost a year and I have only upgrade home assistant once for fear of breaking things. So just yesterday I upgraded HassOS from 2.12 to 4.11 and Home Assistant from 0.102.3 to 0.112.2. So needless to say hassio would not boot up after my updates. So I rolled back to an image I made of my sd card before the upgrades. So, i concluded that was a bad idea. So I am looking for suggestions/feedback on what my upgrade strategy should be. Should I only update Home Assistant and NOT HassOS, or visa versa? Should I just start from scratch with new versions(I dont really want to do this)? Also what happens to all of the addons I have installed which are Configurator, Duck DNS, ESPHome, Mosquitto broker, SSH Server and Samba share. Thanks in advance for your response.

Restoring a configuration made ten releases ago is unlikely to be uneventful (or successful).

When I had jumped by six releases, I reconfigured the new system from scratch, rather than try to make it use my old configuration. I felt that it would take longer to hunt down and fix all the incompatibilities than simply perform a fresh configuration. The process also allowed me to do some ‘house cleaning’ and improve/simplify the configuration. Overall I would say I learned more, with less frustration, than if I tried to force the old configuration to work with the latest release.

1 Like

The likelihood of success goes down depending on the number of releases you need to jump. Sorry I don’t have a simple answer but the strategies I use are:

  • Try it and see if it works, if not roll back
  • Review logs and release notes for each version for clues on what you need to change in config
  • Exclude components and add them back in one at a time
  • Document your configuration and start from scratch with a new install
  • Give up, get a beer and go play world of warships

Upgrade to 0.103.0. See what is broken and fix it.
Upgrade to 0.104.0. See what is broken and fix it.
Upgrade to 0.105.0 See what is broken and fix it.

All the way to 0.112.0

1 Like

Exactly this.

I run a ubuntu machine myself (can be on a raspberry pi aswell) where i run homeassistant as a docker which i delete and recreate every single night. This forces home assistant to update to the latest version every night.

Every few versions something will break, but you will know immediately and it will be a fairly small and painless fix :slight_smile:

Can recommend this method after 2 years of doing this. I used to run HASSIO before, but I ran into similar issues.

SMALL EDIT: Also in the case of docker on ubuntu (or any other OS) it’s really easy to rollback. just change the tag of the image your are loading and recreate the container. This takes about ~1 minute :). So unless theres a breaking change which is irreversible (like 0.111 to 0.112 where the database structure changed) you can always rollback if needed!

Thanks, I am up to trying this. I have only ever updated Home Assistant using the hassio tab in homeassistant which only allows you to update from your version to the most current version. How do I upgrade just a certain version of HA? I am assuming there is some sort of command line? Also, what do I do about Hassio, do I just NOT upgrade that? If I should upgrade hassio from 2.12 to 4.11, is there a command line upgrade for each step of that upgrade?

Using the SSH add-on :

ha core update --version  0.103.0

Forgive me for my ignorance, but when I ssh in, I am as the hass.io command prompt(below) and it seems the update command does not work from there. Am I supposed to be in some other shell or some other syntax?

 | |  | |               (_)
 | |__| | __ _ ___ ___   _  ___
 |  __  |/ _` / __/ __| | |/ _ \
 | |  | | (_| \__ \__ \_| | (_) |
 |_|  |_|\__,_|___/___(_)_|\___/

Our Cli:
$ hassio help

core-ssh:~# ha core update --version 0.103.0
-bash: ha: command not found

You must really be using an old version. Before the name change from Hassio to Home Assistant and later to Home Assistant OS, the command was hassio instead of HA.
so try

hassio core update --version  0.103.0

Although core might be renamed too. In that case run hassio help to see the actual command.

@Robb I think nightly is a little OTT. There is a new major release every three weeks, and maybe up to 6 (usually less) minor releases inbetween.

Also I updated a system to 0.112 successfully but reverted it to 0.111 for a couple of things that I didn’t have time to fix from the upgrade. It still worked, despite a successful 0.112 database upgrade. Strange but true.

Don’t upgrade to the 0.abc.0 versions, but the 0.abc.x versions, with x the highest available number, as the x-versions contain the bug-fixes for the 0 to x-1 point-versions. A little more work but less risk.

Thanks all for the responses, I was able to get current home assistant version 0.112.3 by doing them incrementally. So what do I do about hassio/hassos? Are there similar command line updates for Hassos? Would you recommend that I keep current?

Update Available :tada:

Operating System 4.11

You are currently running version 2.12

I don’t use HassOS, so I don’t know if you can add a version to the update command. It is available.

I Just a follow up to this thread. I ended up starting from scratch which was fairly easy. I first did a full snapshot of home assistant. Then did a fresh install of hassio and home assistant and restored the snapshot after deleting the database. Worked perfect I did not have to fix anything and now I am up to date with Hassio 4.11. Thanks for everyone help.

I have multiple reasons for doing this:

  • This machine runs more than just HomeAssistant. Other docker containers might receive the latest updates.
  • Its an ongoing test to see if I can reprovision my containers whenever there is a disaster (my files get backed up to the cloud and can be restored without too much downtime). I use duplicati for this (also in a docker ofcourse).
  • If any container have a memoryleak (like my HomeAssistant currently does, i wrote about this in another topic), this is more or less a simple reset. And since i’m sleeping in the night anyway, this doesn’t impact any of my demands.

There are some more minor reasons, but these are the major ones I like to solve the way I did :).

Again: I can advise anyone to use this strategy. I’ve been using it for multiple pieces of software over the years.

1 Like