Estuary

MySQL to SQL Server: 3 Ways to Migrate or Replicate Data

Migrate MySQL to SQL Server using SSMA, managed CDC, or CSV import. Compare schema conversion, ongoing synchronization, and one-time transfer options.

mysql to sql server
Share this article

MySQL data can be moved to SQL Server using a dedicated migration tool, a CDC-based replication pipeline, or a manual export-and-import workflow.

The right approach depends on whether you need schema conversion, ongoing synchronization, or just a one-time data transfer.

In this guide, we’ll compare three practical methods:

  • SQL Server Migration Assistant (SSMA) for MySQL: converts MySQL schema objects and migrates data into SQL Server
  • Estuary: backfills selected MySQL tables and then continuously replicates row-level changes into SQL Server using binlog-based CDC
  • CSV + SSMS: manually exports MySQL data and imports it into SQL Server for one-time or occasional transfers

For a full MySQL-to-SQL Server migration, schema compatibility matters as much as moving the rows. MySQL-specific types, AUTO_INCREMENT, collations, stored procedures, functions, and application SQL may need to be converted or rewritten before cutover.

MySQL to SQL Server: 3 Migration Methods Compared

MethodMigration patternOngoing syncSchema conversionBest for
SSMA for MySQLSchema conversion + data migrationNo continuous sync by itselfYesFull heterogeneous migration from MySQL to SQL Server
EstuaryInitial table backfill + binlog-based CDCYesNo full database-object conversionOngoing MySQL table-data replication into SQL Server
CSV + SSMSManual export and importNoManualSmall, one-time, or occasional transfers

The main difference is whether you need to convert the database structure, keep SQL Server synchronized after the initial load, or simply move a snapshot of the data once.

Use SSMA when schema conversion is a major part of the migration.

Use Estuary when selected MySQL tables need an initial backfill followed by ongoing replication into SQL Server.

Use CSV + SSMS when the transfer is small, manual, and does not need continuous updates.

MySQL to SQL Server Schema and Data Type Differences

MySQL and SQL Server use different type systems, identity behavior, schema conventions, and SQL syntax. Before moving data, review the source schema and decide how MySQL objects should map into SQL Server.

Microsoft’s SQL Server Migration Assistant for MySQL can assess MySQL objects, convert supported schema objects, and let you review or customize type mappings before migration.

Common areas to review include:

MySQLSQL ServerMigration note
AUTO_INCREMENTIDENTITYVerify generated key behavior after migration
TINYINT(1)BITCommon mapping for Boolean-style columns
INTINTDirect in many cases
BIGINTBIGINTDirect in many cases
DECIMAL(p,s)DECIMAL(p,s)Preserve precision and scale
VARCHARVARCHAR / NVARCHARReview character set and Unicode requirements
TEXT / LONGTEXTVARCHAR(MAX) / NVARCHAR(MAX)Choose Unicode or non-Unicode based on source data
DATETIMEDATETIME2Review precision and timezone assumptions
JSONNVARCHAR(MAX)SQL Server stores JSON as text rather than a dedicated JSON type
BLOB / LONGBLOBVARBINARY(MAX)Binary data
ENUMUsually VARCHAR + constraint/reference logicNo direct SQL Server ENUM equivalent
Unsigned integersWider signed type or validation logicSQL Server integer types are signed

Schema Differences to Check

Also review:

  • MySQL schemas vs SQL Server databases/schemas: SSMA maps MySQL schemas into SQL Server database/schema targets, and the mapping can be customized.
  • Stored procedures and functions: MySQL procedural SQL may need conversion to T-SQL.
  • Triggers: Review syntax and execution behavior rather than assuming direct compatibility.
  • Collations and character sets: MySQL character-set and collation behavior may differ from the SQL Server target.
  • Indexes and constraints: Validate generated indexes, unique constraints, and foreign keys after conversion.
  • Application SQL: MySQL-specific functions, quoting, pagination, and SQL syntax may need to be rewritten.

SSMA lets you review conversion reports and customize type mappings at the project, database, table, or object level before publishing the converted schema to SQL Server.

The key point is: validate the SQL Server schema before moving the data rather than assuming every MySQL table and type will translate 1:1.

Method 1: Migrate MySQL to SQL Server with SSMA

Microsoft’s SQL Server Migration Assistant for MySQL (SSMA) is designed specifically for heterogeneous migrations from MySQL to SQL Server and Azure SQL.

The migration flow is:

MySQL → SSMA assessment and schema conversion → SQL Server

SSMA can analyze the MySQL source, convert supported schema objects, migrate data, and identify objects that need manual changes. See Microsoft’s SSMA for MySQL documentation.

Step 1: Connect SSMA to MySQL

In SSMA:

  1. Create a new MySQL migration project.
  2. Connect to the source MySQL database.
  3. Select the databases and schemas you want to assess.
  4. Review the source metadata.

SSMA reads the source schema so it can evaluate how MySQL objects map to SQL Server.

Step 2: Run the Migration Assessment

Before converting anything, run an assessment report.

The report helps identify:

  • objects that can be converted automatically
  • objects that require manual changes
  • unsupported MySQL features
  • data type mapping issues
  • procedural SQL that may need rewriting

This step is important because schema conversion is usually the hardest part of a MySQL-to-SQL Server migration.

Step 3: Convert the Schema

Use SSMA to convert supported MySQL objects into SQL Server equivalents.

Review the generated schema carefully, especially:

  • AUTO_INCREMENT → IDENTITY
  • character sets and collations
  • ENUM
  • unsigned integer types
  • stored procedures and functions
  • triggers
  • indexes and constraints

You can customize type mappings before applying the converted schema to SQL Server.

Step 4: Synchronize the SQL Server Schema

Connect SSMA to the target SQL Server instance and synchronize the converted schema.

This creates the target database objects that SSMA is able to convert.

Objects that SSMA cannot convert automatically should be rewritten or recreated manually before the final cutover.

Step 5: Migrate the Data

After the target schema is ready, use SSMA to migrate the MySQL table data into SQL Server.

Monitor the migration for:

  • conversion errors
  • rejected rows
  • data truncation
  • type mismatches
  • constraint failures

After the load completes, validate row counts and critical tables.

When Is SSMA a Good Fit?

Use SSMA when:

  • you need a full MySQL-to-SQL Server migration
  • schema conversion is a major part of the work
  • you want Microsoft-supported migration tooling
  • a one-time migration is the primary goal
  • you can manually remediate unsupported objects

Things to Consider

  • SSMA does not guarantee automatic conversion of every MySQL object.
  • Stored procedures, functions, triggers, and application SQL may still need manual rewriting.
  • SSMA is primarily a migration tool, not an ongoing CDC pipeline.
  • Application cutover and post-migration validation still need to be planned separately.

Method 2: Replicate MySQL Data to SQL Server with Estuary

Estuary can replicate selected MySQL tables into SQL Server using binlog-based change data capture (CDC).

The pipeline looks like this:

MySQL → binary log → Estuary capture → Estuary collections → SQL Server

Estuary’s MySQL source connector reads row-level changes from MySQL’s binary log. It can first backfill existing table data and then continue capturing inserts, updates, and deletes as they occur.

Step 1: Prepare MySQL for CDC

The MySQL source needs:

  • binary logging enabled
  • row-based binlog format
  • sufficient binlog retention
  • a user with replication permissions
  • network access between Estuary and MySQL

The exact setup depends on whether MySQL is self-hosted or running on a managed service such as Amazon RDS, Aurora MySQL, Google Cloud SQL, or Azure Database for MySQL.

Step 2: Create the MySQL Capture

MySQL to SQL - MySQL Capture

In Estuary:

  1. Create a MySQL capture.
  2. Enter the source database connection details.
  3. Discover available schemas and tables.
  4. Select the tables you want to replicate.
  5. Publish the capture.
MySQL to SQL - Capture details

Unless backfill is disabled, Estuary first loads the current table state and then continues reading changes from the MySQL binlog.

Step 3: Configure SQL Server as the Destination

MySQL to SQL - sql server materialization

Use Estuary’s SQL Server destination connector to materialize the captured collections into SQL Server.

You need:

  • SQL Server host and port
  • database name
  • destination credentials
  • network connectivity from Estuary
MySQL to SQL - materialization details

The connector creates and manages the destination tables based on the materialization configuration.

Step 4: Start Ongoing Replication

Once both connectors are published, MySQL changes continue flowing into SQL Server.

This approach is useful when you need:

  • an initial load of selected MySQL tables
  • ongoing replication after the backfill
  • inserts, updates, and deletes captured continuously
  • SQL Server kept updated while MySQL remains active
  • managed CDC rather than operating binlog consumers yourself

What Estuary Does Not Replace

Estuary should be treated as a table-data replication approach, not a complete MySQL-to-SQL Server schema-conversion tool.

You still need separate handling for database-specific objects and logic such as:

  • stored procedures
  • functions
  • triggers
  • users and grants
  • indexes or constraints that need SQL Server-specific design
  • MySQL-specific SQL syntax or application queries
  • schema changes that require explicit review

Use SSMA or manual migration work for those parts of a full database migration.

Method 3: Export MySQL to CSV and Import into SQL Server

For a small, one-time migration, you can export MySQL table data to CSV and import it into SQL Server manually.

The workflow is:

MySQL → CSV export → SQL Server import

This method does not provide ongoing synchronization, but it can be sufficient when the dataset is manageable and a manual transfer is acceptable.

Step 1: Export Data from MySQL

Export the source table or query results to CSV.

For example, you can use MySQL tools or a query-based export workflow to generate a CSV file containing the rows you want to move.

Before importing, check:

  • column order
  • delimiters
  • character encoding
  • date and time formats
  • null values
  • large text or binary columns

Step 2: Prepare the SQL Server Table

Create the destination table in SQL Server with data types that match the migrated values.

For example:

plaintext
CREATE TABLE customers ( customer_id INT PRIMARY KEY, name NVARCHAR(255), email NVARCHAR(255), created_at DATETIME2 );

Make sure MySQL-specific types and behaviors have already been converted to suitable SQL Server equivalents.

Step 3: Import the CSV with SSMS

In SQL Server Management Studio, you can use the Import Flat File or Import and Export Wizard to load the CSV into SQL Server.

See Microsoft’s Import Flat File documentation for the current workflow.

During import, verify:

  • detected column types
  • destination column mappings
  • null handling
  • date/time conversion
  • row counts

Step 4: Validate the Imported Data

After the import completes, compare:

  • total row counts
  • primary-key values
  • null values
  • date/time fields
  • numeric precision
  • text encoding

For important tables, also test the application queries that depend on the migrated data.

When Is CSV + SSMS a Good Fit?

Use this method when:

  • the migration is one-time
  • the dataset is relatively small
  • manual handling is acceptable
  • continuous synchronization is not required
  • you do not need automated schema conversion

Things to Consider

  • Ongoing MySQL changes are not replicated after the export.
  • Schema conversion is manual.
  • Large datasets can become cumbersome to manage as CSV files.
  • Binary data, complex text fields, and encoding differences may require extra handling.
  • CSV import should not be treated as a backup or replication strategy.

How to Minimize Downtime When Migrating MySQL to SQL Server

To reduce downtime, separate the migration into two phases: initial load and ongoing change replication.

A typical low-downtime cutover looks like this:

  1. Prepare and validate the SQL Server schema.
  2. Load the existing MySQL data into SQL Server.
  3. Keep MySQL online while new inserts, updates, and deletes continue replicating.
  4. Monitor replication lag until SQL Server is nearly caught up.
  5. Pause application writes briefly.
  6. Apply the remaining changes and validate critical tables.
  7. Point the application to SQL Server.
  8. Resume writes against SQL Server.

A CDC pipeline such as Estuary can support the ongoing replication portion by continuing to capture MySQL binlog changes after the initial backfill.

The important point is that CDC can reduce the final cutover window, but it does not eliminate the need to validate the target schema, application queries, and SQL Server-specific behavior before switching production traffic.

Which MySQL to SQL Server Method Should You Use?

Choose the method based on whether you need schema conversion, ongoing replication, or a simple one-time transfer.

MethodBest forOngoing syncMain consideration
SSMA for MySQLFull heterogeneous migrationNo continuous sync by itselfStrong fit when schema conversion is the main challenge
EstuaryManaged MySQL table-data replication into SQL ServerYesBest when you need an initial backfill followed by ongoing binlog-based CDC
CSV + SSMSSmall one-time transfersNoSimple, but schema conversion and refreshes are manual

Use SSMA when you need to convert MySQL schema objects and migrate data into SQL Server.

Use Estuary when selected MySQL tables need to stay synchronized with SQL Server while the source remains active.

Use CSV + SSMS when the transfer is small, one-time, and does not need ongoing updates.

The key distinction is that schema migration and data replication are separate problems. SSMA helps with schema conversion, while CDC helps keep SQL Server updated after the initial data load.


Need to keep MySQL data synchronized with SQL Server during migration?

Start building with Estuary or review the MySQL source connector and SQL Server destination connector documentation.

Start streaming your data for free

Build a Pipeline

About the author

Picture of Jeffrey Richman
Jeffrey RichmanData Engineering & Growth Specialist

Jeffrey is a data engineering professional with over 15 years of experience, helping early-stage data companies scale by combining technical expertise with growth-focused strategies. His writing shares practical insights on data systems and efficient scaling.

Real-Time & Batch Pipelines.Simple to Deploy.Simply Priced.

  • $0.50/GB of data moved + $100/month per connector instance
  • Simple usage-based pricing with volume discounts
  • Sub-100ms end-to-end latency for real-time pipelines