Giter Club home page Giter Club logo

mysql2sqlite's Introduction

mysql2sqlite

Converts MySQL dump to SQLite3 compatible dump (including MySQL KEY xxxxx statements from the CREATE block).

Usage

  1. Dump MySQL DB

    mysqldump --skip-extended-insert --compact [options]... DB_name > dump_mysql.sql
    # or
    #mysqldump --no-data -u root -pmyPassword [options]... DB_name > dump_mysql.sql
    
  2. Convert the dump to SQLite3 DB

    ./mysql2sqlite dump_mysql.sql | sqlite3 mysqlite3.db
    

Development

The script is written in awk (tested with gawk, but should work with original awk, and the lightning fast mawk) and shall be fully POSIX compliant.

It's originally based on the newest fork (https://gist.github.com/bign8/9055981/05e65fd90c469c5eaa730823910c0c5f9de40ab4) of the original mysql2sqlite.sh (https://gist.github.com/esperlu/943776/be469f0a0ab8962350f3c5ebe8459218b915f817) with the following patches:

Feel free to contribute (preferably by issuing a pull request)!

License

MIT

History

  • @esperlu created initial version in 2011 as gist on GitHub
  • many different contributors forked the gist and made wildly varying changes, because @esperlu stopped working on it and didn't respond
  • @dumblob took over in Aug 2015 and applied the most important patches from all the forks as well as many his own patches tested on Drupal DB
  • @dumblob added the MIT license under assumption, that the original gist was released into public domain, because despite significant changes, it wasn't clean room engineering.
  • 2016-05-11 17:32 UTC+2 @esperlu declared MIT as a fitting license (also retrospectively) and the original gist as deprecated.

mysql2sqlite's People

Contributors

colmmcmullan avatar dumblob avatar ibukanov avatar meisterlampe avatar motiejus avatar murrant avatar

Watchers

 avatar  avatar

mysql2sqlite's Issues

Tests do not pass

This is output of shtest. Please note the following points:

  1. I cloned a fresh copy from @frrad's repository
  2. bin\shtest.sh in current project is temporary only
  3. I didn't re-run unit_tests
  4. I suited tests according files splitted into pieces by frrad: *.sql, .out (.out will be expected.out)
  5. I re-run mysql2sqlite from those *.sql > actual.out
  6. I compared expected.out vs actual.out and they should be the same, but they aren't

Tests were run on Windows 10 git-bash and WSL (Windows 10 Subsystem Linux) respectively

Anything is wrong in my environment?

Some ideas???

output_from_git-bash

output_from_ubuntu-win10-subsystem

Thanks in advance!!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.