I’m running on a core i5 NUC
It was slow when looking at large data sets for example the energy dash
I’m running on a core i5 NUC
It was slow when looking at large data sets for example the energy dash
made a intermediate db and then renamed that to the V2 db (naming the original _old as a backup)
HI All
I am thinking of migrating my MariaDB back to the original SQLite,
I have been using HA for 7 years, and used to have occasional issue with the SQLite, which is probably why I moved to MariaDB, however I feel it time to move back
My database is only 525MB, so I assume this is small enough to not be worried,
Also is the process still the same as the original post.
Thanks
Yup. The process is still the same.
hi, i have all steps doin exactly but after 2 hours terible stress i delete all and destroy my system. everytime is coming this:
mysql2sqlite version 2.1.12 Copyright (c) 2019-2024 Klemen Tusar
2024-06-01 16:04:14 ERROR 2003: Can’t connect to MySQL server on ‘homeassistant.local:3306’ (111 Connection refused)
2003: Can’t connect to MySQL server on ‘homeassistant.local:3306’ (111 Connection refused)
where is the problem ? i have test all procedure nothing is working. is this prodedure to old and not working anymore because anybody have chance a formel or Koma or Dopelpunkt oder geschweifte klammer? ich hab den kanal so voll …
As indicated by the previous post, the process still works. People can update the original post in case of changes.
If you encounter a change, please update the guide to help others!
I suggest to read through the entire guide carefully and consider if you followed all the steps. Also check The original forum thread for possible solutions.
Hi all. I will provide a follow up to my post from almost a month ago. I finally got some time to implement the migration.
So, I ran the commands, and it took less than 10 minutes. My MariaDB was around 550 just before I did the migration, however the new SQLite is about 1.2GB, I didn’t purge the short-term statistics, so not sure if that is why its larger than expected.
Either way, it should be fine. I will monitor it for the next week and remove the MariaDB add on once I am happy with it.
I do remember back when I migrated to MariaDB probably 5 years ago, it seemed a lot faster than the SQLite, but so far, since I have migrated back, it seems almost the same…
Thanks everyone.
I just reverted back as well.
Running the conversion on my Windows machine with WSL was really fast (<5min for 3Gig database) and copying the file back via Samba share even easier.
Hopefully the new database remains healthy
HI all.
I thought I would ask in this group before I make a new post
As we have seen, there has been some issues with the sqllite database in version 2024.07. Essentially when it does it purge at 4:12am, it freezes, and a reboot seems to fix it.
I know they did some fixes in later versions of 2024.07, but they also said some other fixes won’t be ready till 2024.08. (Due in a few days)
So, my question is are these issues likely to be in our sqllite which we migrated from MariaDB, or because it is essentially a new database, they legacy data won’t be there, and therefore won’t cause any issues.
Has anyone on this chat, who migrated had issues when moving to 2024.07
Why would you want to go back to sqlite anyway? Does mariadb works ok for you? Latest problems were, as i see, only in sqlite, not in mariadb.
But, then again, i’ve had my share of problems (and data losses) with sqlite, so i’m not going back (read above). Not a single problem with mariadb though…
I’d like to keep the discussion on the migration.
Feel free to make a new topic for the MariaDB issue. This way, other users will be able to find it (as explained in the forum rules).
As stated in the original guide, the reason why Nabu Casa recommends SQLite is because it is more stable and better supported these days. This wasn’t always the case but it is now.
The argument: “if it ain’t broke, don’t fix it” is always valid but most people are here because they are interested in the benefits and process of switching back to SQLite, so let’s focus the discussion on that.
Agreed, although my experience is quite contrary: sqlite is less stable, also i went back to mariadb exactly because sqlite DID broke (again), and it broke AFTER they said “now it’s stable”…
Thank you for this detailed description. I just was running the recorder DB on a different server (docker host with mariadb as container) but wanted to migrate back. This post saved me a lot of work and time!
I edited this post a little so that it is more up to date with the current version of HA. Also added alternative commands (pipx) in case people (like me) experience problems using pip install.
Thank you. Working perfect.
Convert the database on external Linux VM is running only some minutes for 3GB SQLite database.
Back to SQLite after many years on MariaDB my HA is a little bit more responsive.
So I think I go back to MariaDB after one day on SQLite.
After restart I must wait 10 Minutes to see data from recoder like graph and some statistic sensor do not work anymore. So I think with some more values a database is better choice.
Home Assistant does periodic optimizations of the database so there is a good chance the issue will disappear on their own. I didn’t dive into the details since I trust Home Assistant to know best (which works for me).
A few gigabytes of database file should not be a problem on a raspberry pi 4.
If MariaDB works better for you, don’t let me hold you back from doing what works for you.
Nice instruction, but from what I understood: you can just turn off the mariaDB and configs that point to that DB when long term data and history does not mean anything to me, right?
So Basically the “easy” version without that much overhead would be just turn off and the system (re)creates the sqlite db, wont it?
Correct.
If you don’t want to migrate for example energy data, you can remove the MariaDB config and HA will start using the default database again.
Thanks a lot for the tutorial! Spent a lot of time trying to get this to work because I can’t update home assistant anymore while using mariadb for some reason (waiting for recorder to start until it gives up, no error messages in 2024.11.4, no response in github issue). In the end it took ~60GB of memory to finish the conversion process but looks like it finally worked.
celebrated too early… home assistant starts, but history (also long term statistics) are gone