Edgewall Software

Changes between Version 1 and Version 2 of SqLiteToMySql


Ignore:
Timestamp:
Jan 2, 2007, 11:59:48 AM (17 years ago)
Author:
anonymous
Comment:

a little suggestion for automation of sql structure cleaning

Legend:

Unmodified
Added
Removed
Modified
  • SqLiteToMySql

    v1 v2  
    1414 3. Use sqlite .dump to dump the structure + data from sqlite into trac.sqlite.sql (unfortunately there's no option to only dump the data).
    1515 4. Remove all the structure ('create table' and 'create index') from trac.sqlite.sql
    16  5. Concatenate trac.mysql.sql and trac.sqlite.sql into trac.sql
     16    You could use this simple perl script:
     17    {{{
     18$ cat cleansql
     19#!/usr/bin/env perl
    1720
     21while (<>) {
     22  $i = $i . $_;
     23}
     24
     25$i =~ s/^CREATE.*?\);$//smgi;
     26
     27print $i;
     28
     29# NEOF
     30
     31$ ./cleansql trac.sqlite.sql >  trac.sqlite.sql.dataonly
     32    }}}
     33 5. Concatenate trac.mysql.sql and trac.sqlite.sql.dataonly into trac.sql
     34    {{{
     35cat trac.mysql.sql trac.sqlite.sql.dataonly > trac.sql 
     36    }}}