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
It's messy because dump files are database vendor specific.
If you're using Rails, a great plugin exists for this. Read: http://blog.heroku.com/archives/2007/11/23/yamldb_for_databaseindependent_data_dumps/
Update
Currently maintained fork: https://github.com/ludicast/yaml_db
Based on Jims's solution: Quick easy way to migrate SQLite3 to MySQL?
This works for me. I use sed just to throw the first line, which is not mysql-like, but you might as well modify dump.py script to throw this line away.
This script is ok except for this case that of course, I've met :
The script should give this output :
But gives instead that output :
with some strange non-ascii characters around the last 0 and 1.
This didn't show up anymore when I commented the following lines of the code (43-46) but others problems appeared:
This is just a special case, when we want to add a value being 'f' or 't' but I'm not really comfortable with regular expressions, I just wanted to spot this case to be corrected by someone.
Anyway thanks a lot for that handy script !!!
I use data loader for migrating almost any data, it helps me to convert MSSQL to MYSQL, MS access to MSSQL, mysql, csv loader, foxpro and MSSQL to MS access, MYSQl, CSV, foxpro etc. In my view this is a best Data Migration Tool
Download Free : http://www.dbload.com
The python script worked after a few modifications as follows:
...
...
...