Migrating from MSSQL to MySQL involves transferring your database schema, tables, and data from one system to another — you also have to migrate triggers and stored procedures, which is difficult due to syntax changes. MSSQL stored procedures are written in T-SQL, while MySQL uses a different scripting language.
It's a time-consuming migration that requires planning and patience, along with cross-database migration tools such as Data Loader or the MySQL Migration Wizard, part of MySQL Workbench.
You might also be interested in: Top 3 tools for converting MSSQL to MySQL

1.1 Analyze your MSSQL database: take an inventory of the databases, tables, stored procedures, views, and other database objects.

1.2 Review your MySQL requirements: make sure your target MySQL server meets the necessary requirements in terms of version, storage capacity, and configuration.
1.3 Backup your MSSQL database: before starting, create a backup to ensure you have a safe copy in case anything goes wrong.

2.1 Install MySQL: download and install the MySQL server on the target machine, ensuring you have permissions to create databases and tables.
2.2 Configure MySQL: adjust configuration settings — memory allocation, buffer pool size, and other parameters — to optimize performance.
3.1 Create the target database: in MySQL, create a new database with the desired name to hold your migrated data.
3.2 Migrate the schema: extract the schema definition from MSSQL — tables, indexes, constraints, and triggers — and recreate these objects in MySQL using SQL statements or a migration tool.
3.3 Convert data types: identify any data type differences and adjust your schema migration accordingly.
| Category | MSSQL | MySQL |
|---|---|---|
| Integer | int, bigint, smallint, tinyint | int, bigint, smallint, tinyint |
| Decimal / Numeric | decimal, numeric | decimal, numeric |
| Floating-Point | float, real | float, double |
| Character | char, varchar, nchar, nvarchar | char, varchar |
| Binary | binary, varbinary | binary, varbinary |
| Date and Time | datetime, date, time | datetime, date, time |
| Boolean | bit | tinyint(1) or bool |
| Text | text, ntext | text, longtext |
Note that additional datatypes may be available depending on the specific versions and configurations, and maximum sizes/precision may vary between the two systems. During migration, carefully review and map data types from source to target to ensure compatibility and maintain data integrity.
3.4 Migrate stored procedures, views, and functions: recreate these in MySQL, reviewing and modifying syntax or logic as needed due to SQL differences between the two systems.
4.1 Export data from MSSQL: extract data using tools like SQL Server Management Studio or the bcp utility, saving it as CSV or a SQL dump. See: How to export data from MSSQL using SQL Server Management Studio
4.2 Convert data formats: adjust date formats or handle NULL values as needed for MySQL compatibility.
4.3 Import data into MySQL: use the MySQL command-line tool or MySQL Workbench to import data, ensuring target tables are empty or properly truncated first.
5.1 Validate the data: compare a sample of data between MSSQL and MySQL, verifying row counts, primary keys, and other critical data points.
5.2 Test application compatibility: update your application configuration to connect to MySQL, and thoroughly test.
See also: Testing and Validating Data After Database Migration
6.1 Update connection strings and configurations: once migration is verified, update connection strings, configurations, or scripts to point to MySQL.
6.2 Implement data synchronization: if MSSQL needs to remain operational during migration, set up a synchronization mechanism to replicate changes to MySQL.
6.3 Decommission the MSSQL database: once confident the migration is successful, decommission MSSQL.
Remember to thoroughly plan and test the migration process in a non-production environment before attempting it live. Database migrations can be complex, so it's crucial to have a solid backup strategy in place to avoid data loss or corruption.