JJB Blog

How to convert an sqlite 2 database into an sqlite 3 database

sqlite2 path/to/olddb .dump > backupfile
sqlite3 path/to/newdb < backupfile


8 Comments

Hello!

I tried this way and it seems to work good, but for a unicode database table fields !! I think that part didn’t work right. So, any Ideas to solve such problem?

Thanks.

Posted by Ahmed on 28 October 2007 @ 3am

Where can I get sqlite2? It doesn’t appear to come with the version distro, at least not for Gentoo.

Posted by lazloman on 8 July 2008 @ 8pm

Like, you know, the internet man.

Posted by John on 12 July 2008 @ 2pm

Sometimes, some distros call sqlite to sqlite2. Try that.

Oh, and I think you can do something like this:

sqlite path/to/olddb .dump | sqlite3 path/to/newdb

Posted by Xephandor on 17 January 2009 @ 8pm

Hallo @lazloman
try this
http://www.sqlite.org/sqlite-2_8_17.zip
http://www.sqlite.org/sqlitedll-2_8_17.zip

Posted by Bobo on 3 March 2009 @ 2pm

I search in Internet and see that all asked how to convert sqlite 2 to sqlite 3. I need vise versa operation! Please do anybody knows how to convert sqlite 3 to sqlite 2? I use SQLite under Windows XP. Thank you.

Posted by Real Hike on 21 September 2009 @ 7am

Real Hike: just do the same, but swap sqlite2 to sqlite3:

sqlite3 path/to/olddb .dump > backupfile
sqlite2 path/to/newdb < backupfile

Posted by Miguel Ferreira on 15 January 2010 @ 2am

I tried this but I think the autoincrement in the primary key of the original database is causing an issue with the import.

Posted by Randy on 21 July 2010 @ 12pm

Leave a Comment