Skip to content

bitalizer/db-migrator

Repository files navigation

MSSQL to MySQL Database Migration

Rust Version License

A Rust project to migrate MSSQL databases to MySQL, including table structures, column data types, and table data rows.

Features

  • Connects to MSSQL and MySQL databases to perform the migration.
  • Converts MSSQL table structures and column data types to their corresponding MySQL equivalents.
  • Transfers table data rows from MSSQL to MySQL.
  • Provides flexibility in configuring connection details, table mappings, and migration options.
  • Handles differences in data types, constraints, and other database-specific details during the migration process.

Dependencies

  • tokio - Asynchronous runtime for Rust.
  • tokio-util - Utilities for working with Tokio.
  • anyhow - Rust error handling library.
  • log - Logging facade for Rust.
  • env_logger - Environment logger for Rust.
  • structopt - Parse command line arguments in Rust.
  • chrono - Date and time library for Rust.
  • toml - TOML parsing and serialization library for Rust.
  • async-trait - Async versions of Rust's trait objects.
  • hex - Hexadecimal encoding and decoding for Rust.
  • futures - Asynchronous programming using Rust's futures.
  • tiberius - MSSQL database driver for Rust.
  • bb8 - Connection pool for Rust.
  • bb8-tiberius - BB8 support for Tiberius.
  • sqlx - Database toolkit for Rust, including support for MySQL.

Usage

Option 1: Compile and Run

  1. Copy the config.example.toml file to config.toml.
  2. Configure the connection details and whitelisted tables for the MSSQL and MySQL databases in the config.toml file.
  3. Customize the table mappings and migration options in the mappings.toml file.
  4. Build and run the migration tool using Cargo:
cargo run --release

Option 2: Use Pre-compiled Binaries

  1. Go to the GitHub Releases page of this repository.
  2. Download the appropriate pre-compiled binary for your operating system and architecture.
  3. Copy the config.example.toml file to config.toml.
  4. Configure the connection details and whitelisted tables for the MSSQL and MySQL databases in the config.toml file.

Arguments

USAGE:
    db-migrator.exe [FLAGS] [OPTIONS]

FLAGS:
    -c, --constraints    Create constraints
    -d, --drop           Drop tables before migration
    -f, --format         Format snake case table and column names
    -h, --help           Prints help information
    -q, --quiet          Activate quiet mode
    -V, --version        Prints version information
    -v, --verbose        Activate verbose mode

OPTIONS:
    -p, --parallelism <parallelism>    Set parallelism [default: LOGICAL_CORES]

Installation

Make sure you have Rust installed. You can install Rust from the official website: https://www.rust-lang.org/tools/install

Clone the repository:

git clone https://github.com/bitalizer/db-migrator.git

About

This project provides a Rust-based solution for migrating MSSQL databases to MySQL.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •  

Languages