Skip to content


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

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

Posted in general.

Tagged with , .


8 Responses

Stay in touch with the conversation, subscribe to the RSS feed for comments on this post.

  1. Ahmed says

    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.

  2. lazloman says

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

  3. John says

    Like, you know, the internet man.

  4. Xephandor says

    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

  5. Real Hike says

    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.

  6. Miguel Ferreira says

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

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

  7. Randy says

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



Some HTML is OK

or, reply to this post via trackback.



Close