Update to 2023.2 and the Database Message

Hello. I´ve updated to 2023.2. And as i started the update, i got an Message like “we update your database, don´t turn off or restart your system”. But: After 6h there are no results. Is there any way to find this message? Or is there a way I can check if this process is complete? A query with mariade --version returned no result. Thx!

[core-ssh ~]$ mariadb --version
-bash: mariadb: command not found
1 Like

I have the same question but for sqlite.
Still running after 6h and still not complete.
DB is around 15G and db-wal is about 3G and keep growing.

Same problem here!
I believe my “upgrade” has now been completed but unfortunately I’m left with no space in my disk.
I believe it’s grown 2x in size and I can’t do anything anymore because I have 0.6GB free.
I know the solution would be to just increase the disk dimension but I think there’s for sure a better solution out there.
Of anyone knows how to fix this (that doesn’t involve deleting the existing dB) please drop a line.

Hi,
I had the same database update after 2023.2 installation. Now I noticed that my history data has disappeared before Jan 25.
Does anyone know how to get back the history?

With almost any database engine, you should always have at least 1.25x the size of your database disk space free as temporary space.

Any rebuild, repack/vacuum, schema change, or big update can make a temp copy of the a table if it’s faster or needed to rebuild the table.

If you ran out of space during the update, add additional space, and restart. The update should resume and try again as long as your disk and database are healthy.

If the message went away on its own, the update completed successfully and there is nothing to do.

My database is growing indefinitely. It’s now 82GB after about 48 hours. Still cannot restart HA because it says it’s still upgrading the database. I don’t think it will ever stop and is stuck forever. I don’t mind starting over with most entities. but I do hate the fact that Im going to lose almost 2 years of energy data because of this.

Check the mysql process list in phpmyadmin.

Well it’s still working on it.

Can’t decide if there is something wrong.

But still 48 hours is a very long time isn’t it? And 80GB for a database aswell

It started around 50 I think. Which is still far too large I think.

For 100GB it took around 40 minutes in testing with a very fast SSD. Unless your CPU or disk is really really slow 48 hours is probably too long and something is wrong with the hardware, disk, or some other system.

You could run SHOW ENGINE INNODB STATUS to see if something else is running a query that is blocking it.

My dB runs on my nas. And it seems it just takes a very long time to update. Is there a way to clean the database and start over without losing energy data? I don’t mind losing anything else except energy data.

Because with my calculations it will take around 200 hours to complete the upgrade.

I’m in a similar situation. My DB upgrade has been running for half a day. DB is ~60GB but it looks like its going to fill the disk before it completes. It would have been nice to know (in the breaking changes perhaps) that the DB upgrade requires 2x the storage and many hours to perform on large databases. If mine fails I hope to at least preserve the energy data, hopefully its a simple as dumping a table, but I haven’t looked at the DB that closely yet.

I stopped my MariaDB and let Home Assistant error out. Then I started my MariaDB and emptied the states table. While keeping anything else. My DB runs fine again and my energy is still intact. DB is back to 1.5GB now. So just empty the states table (don’t delete it) your history of you entities will be gone but energy will be intact.

2 Likes

Thanks for the tip.
I’m going to try an expand my disk (risky while its live and receiving writes), but I’ll take a snapshot before hand just to be safe. If that doesn’t work, then I’ll empty the states table as you suggest. Fingers crossed.