Move schema and data from Microsoft SQL Server to MySQL with minimal downtime.
Cut licensing costs, adopt open-source tooling, and align with cloud-native stacks are the top drivers. MySQL’s wide hosting support and vibrant community make it attractive for fast-growing SaaS teams.
Prepare admin access to both servers, network connectivity, enough disk for export files, and a maintenance window if doing a cut-over.Install MySQL Workbench or MySQL Shell 8.0+ for migration tooling.
Generate a .sql
script via SSMS “Tasks ➜ Generate Scripts”. Exclude “Set ANSI_PADDING” lines and choose “Schema only”. Save per-table files for easier type fixes.
NVARCHAR
➜ VARCHAR
/TEXT
, DATETIME
➜ DATETIME(6)
, MONEY
➜ DECIMAL(19,4)
, BIT
➜ TINYINT(1)
, and UNIQUEIDENTIFIER
➜ CHAR(36)
.Adjust PKs and indexes accordingly.
Point MySQL Workbench “Migration ➜ Run Target” to the edited script or run mysql -u root -p ecommerce < schema_mysql.sql
. Fix errors iteratively.
Use bcp
to export each table as CSV, then LOAD DATA LOCAL INFILE
in MySQL.Suitable for terabyte-scale since it is bulk-insert optimized.
The wizard connects to SQL Server via ODBC and streams data directly. Click-through UI is simpler but slower on large sets.
Install the MySQL Shell plugin mysqlsh util
to produce parallelized dumps, then loadDump
into MySQL 8.0.
Create SQL Server triggers that push incremental changes to staging tables, then schedule nightly exports.At cut-over, run a final delta script before switching application connection strings.
Run row-counts (SELECT COUNT(*)
) on each table, compare MD5 checksums, and execute core business queries (e.g., daily revenue) against both databases for parity.
Enable foreign-key checks off during bulk load, disable MySQL binlog if replication not needed, and batch inserts in 10 k rows.Always stage in a test environment first.
Keep SQL Server read-only during cut-over so rollback is simply repointing the application. Retain CSV dumps and MySQL backups for quick restore.
.
Yes. MySQL Workbench Migration Wizard migrates schema and data via ODBC. It is ideal for small to mid-size databases (<50 GB).
Convert SQL Server IDENTITY to MySQL AUTO_INCREMENT. Ensure inserts exclude the column or set session variable sql_mode='NO_AUTO_VALUE_ON_ZERO'
for zero-based IDs.
No one-click conversion exists. Rewrite in MySQL’s SQL/PSM or move logic to application code. Use Workbench to import bodies for manual editing.