mysql to sqlite

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Gandalf

    mysql to sqlite

    I'm trying to convert mysql database to sqlite. is their any free tool
    that does that?
    I can convert my mysql db to XML file through phpmyadmin, will it be
    easier to convert from XML to SQlite then from Mysql?
  • =?ISO-8859-1?Q?Gerhard_H=E4ring?=

    #2
    Re: mysql to sqlite

    Gandalf wrote:
    I'm trying to convert mysql database to sqlite. is their any free tool
    that does that?
    I can convert my mysql db to XML file through phpmyadmin, will it be
    easier to convert from XML to SQlite then from Mysql?
    Did you look at http://www.sqlite.org/cvstrac/wiki?p=ConverterTools ?

    I'd try one of these if I need it. Otherwise it seems easier for me to
    parse XML than to try out all the options of mysqladmin, which probably
    still won't produce anything that can directly be fed to sqlite3.

    It would be a nice programming exercise. Hint: You can pretty safely
    ignore all type information you get from MySQL, because types in SQLite
    depend on the inserted values, and not the table definition.

    -- Gerhard

    Comment

    • Nick Craig-Wood

      #3
      Re: mysql to sqlite

      Gandalf <goldnery@gmail .comwrote:
      I'm trying to convert mysql database to sqlite. is their any free tool
      that does that?
      I can convert my mysql db to XML file through phpmyadmin, will it be
      easier to convert from XML to SQlite then from Mysql?
      I'd probably create the sqlite tables first by editing the database
      schemas produced by mysqldump to make the acceptable to feed to
      sqlite.

      I would then write a script which connects to both databases at once
      and copies the table data across.

      (At least that is what I did last time I needed to do that which was
      from MSSQL->MySQL).

      You'll find that different databases have subtly different ways of
      doing things (eg autoincrement fields on mysql) so you'll most likely
      need a custom script anyway.

      --
      Nick Craig-Wood <nick@craig-wood.com-- http://www.craig-wood.com/nick

      Comment

      Working...