Best practices for update (for an unexperienced HA user)?

I am a fairly new HA user and still trying to find my way around HA. I wonder what is the recommended/best practices to update HA for an unexperienced user like me?

I installed HA some months ago and configured things I needed, then I just let it do the job. I am afraid of updates because I see that it’s not uncommon for an update to break things.

Now I see in HA dashboard:

Home Assistant Core 2021.1.1
You are currently running version 0.116.2

Operating System 5.10
You are currently running version 4.15

And I am not sure if I should click on “UPDATE”.

How often do you update your HA? Is there anything like a LTS version of HA?

Regards,
Tony

1 Like

In general, and this is for any system not just HA, doing a backup before you pull that trigger is always wise. In my own experience I had to fall back on this as the latest update broke my Z-Wave. Restoring can be problematic so you might consider SSH to the HA machine and do an ‘ha core stop’ and then make a copy of the database because restoring it will muck it up.

1 Like

Hit update, fold your hands and pray…

I’m always one version behind and I always read the release notes and use the breaking change integration.

I have enabled automatic updates for Home Assistant Core. If something brakes, I check the release notes and eventually go back.

thank you for your comments, much appreciated.

what is more risky, update HA Core or HA OS? Can I just update HA Core without updating HA OS?

I guess the analogy to linux is that HA OS = a linux distro (e.g. Ubuntu) and HA Core = a package (e.g. Apache). In order to update Apache, sometime I have to reinstall Ubuntu because the new version is not available for the current OS. Is my understanding correct?

I update at no more than 2 updates behind, of if no relevant breaking changes I update a day or so after release.

I have a rigorous backup schedule though, full snapshot every second night with MariaDB stopped for the update so if I need to restore I can do so without loss of historical data. All my backups are stored external to the HA host so I can access them for a restore in the event of a total update failure.

If you are running on a Pi, you also have the advantage of taking an image of your system SD and restoring from that, however the full HA install then snapshot restore isn’t that difficult.

For your upgrade from 0.116, reading the breaking changes will be the most tedious but important part.

Hi @zoogara, how do you stop MariaDB before the backup and restart it afterwards?

1 Like

For your upgrade from 0.116, reading the breaking changes will be the most tedious but important part.

does it mean I must read all release notes between 0.116 and 2021.1.1 and check if there are breaking changes?

I found this GitHub - custom-components/breaking_changes: Component to show potential breaking_changes in the current published version based on your loaded components
Can it be used to make the update process safer?

I feel quite overwhelmed by this; mostly likely because I haven’t devoted enough time to maintaining my HA instance on a regular basis.

I’m not suggesting this is how zoogara does it, but there are service calls available to start and stop addons. You could probably make an automation that stops the addon, waits a few seconds for it to stop, then starts the backup.

As for starting it again, that’s a very good question. Starting it is easy, but I’m not sure how you would detect a snapshot being finished.
I don’t believe there’s an event fired when a snapshot is finished, but I’m not sure.
It might be possible to watch the supervisor log to not when it’s finished?
I’m curious how he does it as well.

Here’s the example given for stopping the core_ssh addon. addon_start has the same syntax.

hassio.addon_stop
  - addon: core_ssh

I cheat - the Google Drive Backup custom component https://github.com/sabeechen/hassio-google-drive-backup has an option to stop any add-on before taking the snapshot, then start it again when finished.

You can use the component without Google Drive if you prefer to copy snapshots to a local storage device rather than trusting Google.

2 Likes

I am not sure regarding that custom component, I assume someone maintains a list of changes to check against otherwise how does it work?

I have bee bitten on the bum a couple of times by breaking changes, so I would spend a bit of time checking no matter how you do it.

I haven’t found yet the courage to pull the trigger and do the update. However I see this warning on the HA page:

Make sure you run at least Home Assistant Core 2021.1.5

so I’d like to update my HA. I have checked https://github.com/home-assistant/core/releases from the latest release down to 0.116.2 and found no breaking changes, so I hope it will go well.

btw I don’t know why this didn’t work (should show up to 100 release notes in one page):
https://github.com/home-assistant/core/releases?per_page=100

I’d like to ask before I pull the trigger:

  • what should I do if the update breaks? Reinstall from scratch and import the full backup?
  • should I update HA Core first and then HA OS, or the other way around?

Well if you are running on a Pi, via SD, you could take the card out and make an image of it…

Otherwise yes, reinstall and restore, though there is a bug that sometimes stops you importing the snapshot during install. Not sure if it is fixed and depended on the size of your snapshot.

Workaround is to copy snapshot over via FTP for restore.

again very valuable info. I have an Intel NUC, will backup the entire SSD before upgrade.

Thank you @zoogara for your assistance with Home-Assistant :slight_smile: I find that HA requires a non-trivial amount of time, knowledge and experience to run.

a brief update, might be helpful for people in similar situation: I backed up the entire ssd to an USB disk using Clonezilla Live, then update HA OS, then HA core. All went without problem.

Fantastic - obviously you have a cleaner config than I ever had, I can remember at least 3 times where an upgrade broke things.

I you have a decidated NUC for Home Assistant and you get paranoid about update breaking things, I would advise consider to use your NUC as a virtualization server (for instance Proxmox is perfect) and use Home Assistant in a Virtual Machine.
This solution has many advantages. You can use your server for many other things, and you can backup wherever/whenever you want, replicate wherever/whenever you want, restore,… your HA VM very very easily.
We are many happy HA users in this situation. :slight_smile:

this is interesting. I am familiar with Proxmox and use it to host a bunch of VMs at Hetzner. But for my tiny NUC (NUC Celeron 847E HTPC) I didn’t consider Proxmox, it seems an overkill.

I also have a Synology Disk Station 718+, which perhaps can be used to host a VM for HA. I should explore this option. One thing I am not sure about is how to connect the ConBee II Zigbee USB-Gateway to a VM.

Plug your USB stick on your Proxmox host, and in your VM hardware parameters page, just add it as a USB peripheral. Easy ! :slight_smile: