Export mysql tables to Mongo database

View project on GitHub


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: [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
--tables "users,products"
--host "localhost"
--user "root"
--password "MysqlSecRetPassword"
--mongo "mongodb://localhost:27017"
--mongodb "MongoDBNameForExport"

Support or Contact

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