Script to import SQLite3 database into MongoDB database.
- Python 3.6+
- Running mongod instance
$ git clone git@github.com:kylepw/sqlite3tomongo.git && cd sqlite3tomongo $ pip3 install pipenv $ pipenv install && pipenv shell
$ python3 sqlt3tomongo.py -h usage: sqlt3tomongo.py [-h] [--host string] [--db string] [-a] [-v] file Import SQLite3 database into MongoDB. positional arguments: file sqlite3 database file optional arguments: -h, --help show this help message and exit --host string mongodb uri --db string, --database string mongod database name (defaults to filename) -a, --append append to existing collections (dropped by default) -v, --version show program's version number and exit
To view logs:
$ LOGLEVEL=info python3 sqlt3tomongo.py yoursqldb.db --host 'mongodb://yourmongodb:27017'
$ python3 -m unittest test_sqlt3mongo.py