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

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.
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.
Hello, does it still work?
I am trying to migrate from sqlite to mariaDB and get this error
Traceback (most recent call last):
File "/usr/bin/sqlite3mysql", line 5, in <module>
from sqlite3_to_mysql.cli import cli
File "/usr/lib/python3.12/site-packages/sqlite3_to_mysql/__init__.py", line 5, in <module>
from .transporter import SQLite3toMySQL
File "/usr/lib/python3.12/site-packages/sqlite3_to_mysql/transporter.py", line 16, in <module>
import typing_extensions as tx
ModuleNotFoundError: No module named 'typing_extensions'
command:
sqlite3mysql --sqlite-file /config/home-assistant_v2.db --mysql-database homeassistant --mysql-host DB_IPADDRESS --mysql-port 3308 --mysql-user ha --mysql-password <secret>
thank you
I posted in July last year, that this topic is effectively dead since there is no longer a benefit to migrating to mariadb or mysql.
I migrated back to sqlite sometime later last year, and performance is better than when I was using mariadb.
That said, the errors indicate there are import modules that are not installed. you will need to find the needed modules referenced above if you really want to migrate. Migration is not recommended unless you are an experienced db administrator.
good luck!
Hour did you migrate back? Were there any issues (like type conversion I had to do when migrating to Maria DB)? What size is your DB? I might consider moving back too
Really? I suppose that you did something wrong with MariaDB then. How big your database is?
I wound up just abandoning the mariadb database. I really wasn’t interested in past information older than 30 days, so I just migrated my setup to a new instance and left the old behind. All the integrations and adding I had came over just fine and began with data from the point were I dropped mariadb and started using sqlite. I went back to sqlite about a year ago, and things are all good with the new version running on a raspberry pi 4 on a Samsung 128GB sd card with plenty of space on it for HAOS and data. When I do a backup it is around 80 MB so not using much of the SD card at all. I have been running HA on SD cards for about 7 years or so with no problems (knock on wood)!
I did not run the mariadb server on a separate machine, so that probably accounts for the ‘increase’ in performance. I’m happy with the sqlite setup now.
It worked for me when I realized there really wasn’t any data I left behind that I would miss.
I do recall someone starting a thread with a howto for migrating back to sqlite, but didn’t use it myself.
Regards!
PS. here is a link to the information I found:
Hello I have just successfully migrated DB from SQLite to MariaDB
I wrote step by step process to blog:
Migrate database from SQLITE to MariaDB (With full history)
I did it with 5GB SQLite DB with data from 2023 with success!
(MariaDB 12 in Docker in virtual machine on preoxmox)
do it on your own risk
Hello, I just wanted to mention that I have just successfully migrated HA Version 2025.9.1 from sqlite to mariadb using this tool and instructions:
