http://www.sqlite.org/cvstrac/wiki?p=ConverterTools
Please, read the possible solutions on SQLite CVSTrack. It depends in what direction you need to migrate: Sqlite -> Mysql or Mysql -> Sqlite.
I find it interesting to migrate to Sqlite, because overall performance of data analysis is faster in SQLite from 2.5x to 20x (and some queries in MySQL still can't be performed likt nested selects with limit clause).
You may need to correct your table schema. Here we go:
* MySQL to SQLite3 (shell script)
A quick way to convert a MySQL DB to SQLite3 is the following shell script (it does not claim to be complete):
#!/bin/sh
mysqldump --compact --compatible=ansi --default-character-set=binary mydbname |
grep -v ' KEY "' |
grep -v ' UNIQUE KEY "' |
perl -e 'local $/;$_=<>;s/,\n\)/\n\)/gs;print "begin;\n";print;print "commit;\n"' |
perl -pe '
if (/^(INSERT.+?)\(/) {
$a=$1;
s/\\'\''/'\'\''/g;
s/\\n/\n/g;
s/\),\(/\);\n$a\(/g;
}
' |
sqlite3 output.db
Edited 1 time(s). Last edit at 05/28/2006 01:39AM by alexey petrovsky.