Migrating home assistant database from sqlite to mariadb.. ONLY if you are VERY familiar with Database administration

I remember some of my graphs were seriously messed up after clean import, but I haven’t noticed that immediately.

I have trouble with connecting to the MariaDB that the port number is not an integer

image

I did already some checks in the transporter.py from sqlite3mysql and the port number shows with type as <class ‘int’>

I am running phyton 3.10 on Ubuntu 22.04

Found the solution to solve all dependences, on the site source location from the tool GitHub - techouse/sqlite3-to-mysql: Transfer data from SQLite to MySQL there is the solution to use a docker container which contain the whole tooling.

1 Like

you may need to add in --break-system-packages when runinng “pip3 install sqlite3-to-mysql” command (i had to)

I know this is an old thread. But I did find it useful! I used the method that used the ‘sqlite3-to-mysql’ script and it did work; but my long term statistics are not currently found. I’ve been searching this thread quite a lot and reviewing various methods but I’ve not yet found a solution.

If you are not an admin for mysql, the recommendation is to not migrate to mysql, and instead remain with sqlite. There is no benefit . I have not migrated back to sqlite from mysql, only because I am ok with it at this time. There may come a time when I migrate back to sqlite. If you still want to try to migrate to mysql, you will be on your own. I have not tried using history, and there are several comments in this thread indicating troubles using history after migration. with no real solutions as you have discovered.

You may want to start a new topic specifically for your request as this thread is pretty much dead.

Regards.

As far as I remember the values were stored as a different type, after correcting that it all worked. The information on how to do it (which was working at the time people were trying it) is all in this thread.