Anyone know a quick easy way to migrate a SQLite3 database to MySQL?
相关问题
- sqlyog export query result as csv
- NOT DISTINCT query in mySQL
- MySQL: conduct a basic search
- SQL/SQL-LITE - Counting records after filtering
- Why sometimes there is one of more gap(s) in the v
I usually use the Export/import tables feature of IntelliJ DataGrip.
You can see the progress in the bottom right corner.
[]
Get a SQL dump
Import dump to MySQL
For small imports:
or
This will prompt you for a password. Please note: If you want to enter your password directly, you have to do it WITHOUT space, directly after
-p
:For larger dumps:
mysqlimport or other import tools like BigDump.
BigDump gives you a progress bar:
I recently had to migrate from MySQL to JavaDB for a project that our team is working on. I found a Java library written by Apache called DdlUtils that made this pretty easy. It provides an API that lets you do the following:
The tools that we ended up with weren't completely automated, but they worked pretty well. Even if your application is not in Java, it shouldn't be too difficult to whip up a few small tools to do a one-time migration. I think I was able to pull of our migration with less than 150 lines of code.
There is no need to any script,command,etc...
you have to only export your sqlite database as a
.csv
file and then import it in Mysql using phpmyadmin.I used it and it worked amazing...
If you are using Python/Django it's pretty easy:
create two databases in settings.py (like here https://docs.djangoproject.com/en/1.11/topics/db/multi-db/)
then just do like this:
I have carefully checked all the answers in this post, as well as the answers in another related post Translating Perl to Python. Yet none could fully solve my problem.
My scenario is I need to migrate a database of Trac from sqlite to MySQL, and the database contains a lot of tech-based wiki content. Therefore inside the
INSERT INTO
values, there could be SQL statements likeCREATE TABLE
andAUTOINCREMENT
. But the line-by-line replacement could have wrong replacements there.Eventually I have written my own tool for this purpose:
https://github.com/motherapp/sqlite_sql_parser
The usage is relatively simple:
python parse_sqlite_sql.py export.sql
Two files would be generated:
export.sql.schema.sql
andexport.sql.data.sql
. One for updated DB schema, and the other for updated DB data.One could do further manual modifications on the DB schema file using any text editor, without worrying about changing the content.
Hope it could helps others in future.