Free SQLite to MySql Converter - Super Easy!
Heres how to copy my a development SQLite Database into a MySQL Production Database in 5 Easy Steps. Here’s the easiest way to do it. Seriously:
1. Install the SQLite Manager Firefox Addon
2. After the Addon is installed, in Firefox, go up to Tools > SQLite Manager (Opens the SQLite Manager Addon Window)
3. Click on the “Connect Database” Icon, looks like the Folder Open icon in any other program. Locate your SQLite Database file.
In a Ruby on Rails project you can find it in your rails_project > db > development.sqlite3
4. Back in the SQLite Manager Firefox Addon Window, go up to Database > Export Database (It will automatically export it as a SQL file just about ready to import into MySQL after the next step
5. Open that .sql file that was just exported in any basic text or code editor (ex: Notepad, TextEdit, TextMate, etc…). All you have to do now is do some find and replace SQLite specific syntax to MySQL syntax (easy):
find: AUTOINCREMENT - replace: AUTO_INCREMENT
find: ” - replace: [blank space - nothing - delete them all!!!]
Delete any line with this in it: “sqlite_sequence”, like the whole row. Example, you would delete both these rows:
CREATE TABLE sqlite_sequence(name,seq);
INSERT INTO sqlite_sequence VALUES(’teams’,4);
Now it should be ready to import into your MySQL database. I used phpmyadmin by just going to yourhostingdomain.com/phpmyadmin, then clicked on the import link on the phpmyadmin front page, and browsed for our file we just finished modifying. You should be ready to rock.
Extra Reading
Here’s another article that explains only what is going on, but a good read nonetheless: Quick Easy Way to Migrate SQLite 3 to MySQL?
If you enjoyed this post, please consider to leave a comment or subscribe to the feed and get future articles delivered to your feed reader.



Exactly what I was looking for. Worked like a charm.
Thanks!
Thanks so much, all working.
Thank you for your write up!
I´m exporting a relatively big sqlite database right now and this works pretty well…
i have two suggestions though (at least for rails apps):
- boolean needs to be replaced with tinyint(1)
- doublequotes should not be replaced with a blank string (breaks text fields that actually have doublequotes in them)… right now i´m replacing with backticks but that´s not ideal either.
cheers,
Alexander
Thanks! I was just looking to move a database exported from my iPhone and this worked beautifully.
Ted
thank you so much.
firefox got frozen because was a large db, but i got standalone program and i exporting right now
Thanks for the pointers, but how do you get around sqlite’s dislike for proper creates? I can’t seem to figure out how to get it to include the length of a field in the create syntax?
Any ideas?
thanks
Martin
Спасибо большое!!!
excellent. saved me buying the $80 tool I saw elsewhere so donated the recommended $5 on the firefox add-in page.