This project is a MySQL to MongoDB Migration Tool built using Python and Streamlit. It allows users to migrate data from a MySQL database to a MongoDB database through an interactive web-based UI.
- Frontend: Streamlit UI for user interaction
- Backend: Python scripts for data extraction, transformation, and migration
- Database: MySQL (source) and MongoDB (destination)
- Connects to MySQL and fetches data
- Converts MySQL data into MongoDB-compatible format
- Inserts transformed data into MongoDB
- Interactive UI to input database details and trigger migration
├── main.py # Main application (Streamlit UI)
├── migrate.py # Migration script
├── mysql_connector.py # MySQL connection and data fetching
├── mongo_connector.py # MongoDB connection and data insertion
├── schema_transform.py # Data transformation logic
├── requirements.txt # Dependencies
└── README.md # Project documentation
Ensure you have Python 3.x installed, then install the required libraries:
pip install -r requirements.txtEnsure both MySQL and MongoDB are running:
mysql -u root -p # Start MySQL
mongod # Start MongoDBstreamlit run main.pyThis will launch a web-based UI where you can enter MySQL and MongoDB details to start migration.
- Enter MySQL connection details (host, user, password, database)
- Enter MongoDB connection details (host, port, database)
- Click "Start Migration"
- Wait for migration to complete and check MongoDB for the data
After migration, run:
mongo
use your_mongo_db
show collections
db.your_table_name.find().pretty()- Uses password masking in the UI for security
- Can be extended to support SSL for database connections
- Ensures date/time compatibility for MongoDB storage
- Batch Processing: Can be optimized to migrate large datasets in chunks
- Parallel Processing: Can use multithreading for faster execution
- Indexes in MongoDB: Ensures efficient queries after migration
This tool provides an easy-to-use, interactive solution for migrating data from MySQL to MongoDB. It ensures proper data transformation and smooth migration, making it useful for developers and database administrators.