This project provides a flexible and extensible framework for performing database migrations across various database systems, including MySQL, MongoDB, and Elasticsearch.
The project is structured around the concept of a MigrationBase
abstract class, which serves as a foundation for creating specific migration modules for different database systems. The project includes the following modules:
MongoMigration
: Handles MongoDB migrations using .py based migration scripts.ElasticsearchMigration
: Manages Elasticsearch migrations with .py based migration scripts.MySQLMigration
: Provides capabilities for MySQL migrations using SQL files.
A MigrationManager
class is also included to orchestrate and execute migrations across the different modules.
-
Clone the repository to your local machine:
git clone https://github.com/ErrenYeager/Database-Migration.git
- Implement migration logic by extending the
MigrationBase
abstract class. - For MongoDB migrations, use the
MongoMigration
module with python scripts. - For Elasticsearch migrations, utilize the
ElasticsearchMigration
module with python scripts. - For MySQL migrations, use the
MySQLMigration
module with SQL migration files.
- Use the
MigrationManager
class to run migrations across all modules.
- Python 3.x
- The following Python packages are required and can be installed using
pip
:mysql-connector-python~=8.1.0
pymongo~=4.5.0
elasticsearch~=8.9.0