Mysql2Mongo

Export mysql tables to Mongo database

View project on GitHub

Info

Python script that allow quick export MySQL tables to MongoDB database. It's using "pagination" and will not consume a lot of memory during his work.

Required modules:

pip install pymongo
pip install MySQL-python

Quick export from MySQL database to MongoDB using python.

Usage: main.py [options]

Options:
  -h, --help            show this help message and exit
  -t TABLES, --tables=TABLES
                        List of exported tables by comma
  --host=HOST           MySql host
  -u USER, --user=USER  MySql username
  -p PASSWORD, --password=PASSWORD
                        MySql password
  -d DATABASE, --database=DATABASE
                        MySql database
  -m MONGO, --mongo=MONGO
                        MongoDB connection string
  --mongodb=MONGODB     MongoDB databse for exported data

Command line example

main.py
--tables "users,products"
--host "localhost"
--user "root"
--password "MysqlSecRetPassword"
--database="shop"
--mongo "mongodb://localhost:27017"
--mongodb "MongoDBNameForExport"

Support or Contact

Having troubles ? Contact with me and I’ll help you sort it out.