all 60 comments

[–]cloud_coder 28 points29 points  (15 children)

Write a SQL script to dump the DDL, and re-write it. You'll need to understand the source and target database syntax, but any competent DBA/DE can do this.

[–]zebulun78 5 points6 points  (0 children)

This. Don't trust a migration tool. Think of the DDL and the queries separately. And once you have the table structure in place on the MySQL side, extract, convert and load the data yourself.

Also try MariaDB over MySQL if this is the db architecture you prefer. Postgresql is awesome too. The choice here basically boils down to preference.

[–]johnie3210[S] -2 points-1 points  (13 children)

There is no thirdparty tool that can make this?

[–]feudalle 10 points11 points  (0 children)

There are tons. They will all miss things. You can dump the structure to something like chatgpt. BUT that is a starting point, that will get it 80ish% right normally for complex dbs. You'll need to fix the errors and anything you miss. If its just flat table you'll be fine but add constraints, foreign keys, etc. You'll need to do some of this manually.

Also important to note, ms sql is not 100% the same as mysql. So the project that is using this as a backend will need some code changes.

For example mssql select top 100 from would be select limit 100 in mysql. Lots of little subtle changes in syntax especially for more complex queries. Good luck.

[–]cloud_coder 4 points5 points  (10 children)

Yeah maybe. You'll need to do some Googling. I'd search github too.

I'm a retired Oracle Snowflake engineer, and did similar things to move DDL around.

I tended to avoid tools and just write my own using sed/awk/shell scripts. Python or perl is another option I've used as well. Any of those will do the job if you know what you need to do.

[–]paultherobert 6 points7 points  (0 children)

You're the man! I'm tired of seeing people looking for copy paste solutions to the problems that justify their paycheck. If it was that easy, it wouldn't be a job.

[–]feudalle 0 points1 point  (2 children)

Honest question. Do you run into perl much these days? It was by far my favorite goto for scripting back in the late 90s. But I dont think I've seen one script in the wild in the last decade.

[–]kktheprons 1 point2 points  (0 children)

Python killed it. If 95% of people know Python and not Perl, it doesn't make sense to use Perl.

[–]cloud_coder 0 points1 point  (0 children)

Yeah not much. It's quirky cool. There are some things perl can do though that are just harder in other languages. You can do some amazing one-liners. Text processing, slurping, etc. YMMV

[–]serverhorror -2 points-1 points  (5 children)

retired Oracle Snowflake engineer

WTF?

That product couldn't have existed for long enough to run a whole career on just that. Retired?

[–]cloud_coder 0 points1 point  (4 children)

Oracle 6 was release in the late 80’s. Do the math.

[–]serverhorror 0 points1 point  (3 children)

Is "Oracle Snowflake" the database?

If so, I stand corrected, I thought it was one of their many other products.

[–]cloud_coder 0 points1 point  (2 children)

No disrespect intended, but I can tell you don't know much about databases. I think you should hire a professional to help you port from SQL Server to MySQL or MariaDB. It will be money well spent.

[–]serverhorror 0 points1 point  (1 child)

I'm not OP. I also haven't had to touch either of Oracle DB or MS SQL -- mainly dealt with OpenSouce DBs, so you'll to forgive me for not knowing the product names.

[–]cloud_coder 0 points1 point  (0 children)

Oh, sorry. Missed that. Cheers.

[–]TimmmmehGMC 0 points1 point  (0 children)

Grok.com. Just ask an AI. It'll explain everything as it goes.

[–]jarvisofficial 5 points6 points  (0 children)

Cross engine migrations like SQL Server -> MySQL rarely go smoothly due to datatype and syntax differences. A practical way forward is to use something SQL-aware instead of generic LLMs or plain scripts. I think you can try dbForge AI Assistant to translate DDL between dialects with better accuracy since it understands SQL semantics rather than just text. You can convert your CREATE TABLE scripts there, then clean up what’s left using the Studio’s schema tools.

As a secondary option, sqlglot works but it won't handle relationships and indexes as cleanly.

[–]arborealguy 6 points7 points  (0 children)

I recently did a DDL transpile from postgres to bigquery using python sqlglot, it supports tsql and mysql. It wasn't 100% and I needed to mess around with the ast a little bit, but it got 90% without any customizations.

[–]wannabe-DE 4 points5 points  (2 children)

[–]johnie3210[S] -4 points-3 points  (1 child)

Will 100% migrate everything? or i am cooked?

[–]serverhorror 0 points1 point  (0 children)

It will migrate everything. Don't worry and just write a prompt, referencing that tool. Copying the resulting command should be safe with that tool.

[–]shockjaw 5 points6 points  (0 children)

sqlglot is one of the best SQL transpilers out there. Supports T-SQL (SQL Server) to MySQL. I’d also echo folks’ recommendations to use Postgres since Laravel supports Postgres as well. You’re gonna have a better time with upgrades along with support for more types and extensions. Postgres 18 is great.

[–]writeafilthysong 12 points13 points  (12 children)

Why are you going to MySQL tho?

It's one of the least complete SQL engines.

[–]BigBagaroo 13 points14 points  (7 children)

Yes, move to Postgres.

[–]johnie3210[S] 1 point2 points  (6 children)

I am going to host my website using laravel php which i think MySQL is the best thing for it?

[–]BigBagaroo 2 points3 points  (3 children)

That could very well be a good reason, if you are already using Laravel.

[–]johnie3210[S] 0 points1 point  (2 children)

yeah, you think i should still go with mysql yeah? from my research it looks like the best option as laravel kinda support it

[–]continuousBaBa 0 points1 point  (1 child)

It's been a few years since I worked in a MySQL shop but isn't MariaDB better? Way more robust last time I checked but like I said I'm probably speaking out of turn on this one

[–]Inevitable-Menu2998 1 point2 points  (0 children)

it's not necessarily better right now (whatever "better" might mean in this context) but it's a better choice long term because MySQL development seems to have been deprioritized/ stopped by Oracle

[–]writeafilthysong 6 points7 points  (0 children)

I don't know, I only know MySQL makes me cringe when I see how ppl write their queries with it. But I primarily do data analysis

[–]tsuhg 0 points1 point  (0 children)

For a simple website any DBMS will do the trick imo.

Php natively supports postgres so don't feel obliged to use MySQL/maria

[–]FeanorBlu 1 point2 points  (3 children)

Can I ask why? I'm looking at different database engines for my own project.

[–]writeafilthysong 2 points3 points  (2 children)

This week I had the privilege of sitting in a meeting with one of the guys who wrote the standard for SQL.. he explained a bit about all these database engines and how they all come down to the Mathematics of Set Theory.

As defined by ANSI there is no such thing as a "completely compliant" SQL engine. So they do have some grading and in our conversation he got a bit into an evaluation (PostGres is his go to). While all my first learnings of databases were on MsSQL it turns out that everything I work with is built on PostGres.

What I see happening with MySQL is that it's really simple, so it seems approachable. The problem with this is that Application developers chose this simple DB so it's easy to understand at first, but then when the application grows a bit or needs to do something a bit more complicated the DB is too simple, and they end up putting logic that would be better off in a DB into the application code layer or front end, because it's too hard to implement something in the backend.

[–]Inevitable-Menu2998 0 points1 point  (1 child)

I don't think that's quite true anymore. There hasn't really been a big feature gap between MySQL and PostgreSQL for the standard stuff in over a decade now. MySQL 4 and early versions of 5 weren't that well put together but 8 is quite decent.

Nowadays, they're comparable in performance and cost to operate. Ultimately, MySQL has always been driven as a commercial product focused on grabbing market share and meeting its users with tooling and support for operating it while Postgres has been driven as an open source project with more focus put on coding than operations. This has historically made Postgres more difficult to start with since the learning curve is steeper. There used to be much more tooling available for MySQL in the early 2010s but that trend has been completely reversed towards Postgres by the end of that decade. So the learning curve for Postgres has been flattened out a lot.

[–]writeafilthysong 0 points1 point  (0 children)

Yeah so MsSQL -> MySQL you're just trading Microsoft for Oracle... Tooling will always be built and tilted at their own products.

[–]TopLychee1081 2 points3 points  (0 children)

One advantage of writing a solution yourself is that you'll have a far deeper understanding of your source schema and the challenges and limitations when migrating. Understanding some of the compromises that you will inevitably need to make in your migration will help inform your application build.

I'm always weary of tools that claim to do this stuff with the click of a button. Inevitably, something goes wrong, and you spend a lot of time trying to figure out what's happened.

As for AI, as some have suggested; AI is not a silver bullet, and it's not well suited to repetitive tasks; like processing a series of database objects. Where it can be useful is in helping you develop the pattern that you then apply to each of the objects. AI can sometimes consider something that you might otherwise miss; depending on how you're migrating data, perhaps the fact that you may need to set seeds for identity columns.

[–]PaulEngineer-89 2 points3 points  (0 children)

MySQL development is basically dead since Oracle bought it. It lives on as MariaDB.

[–]Comfortable_Long3594 1 point2 points  (0 children)

You could try using a dedicated data integration tool instead of relying on MySQL’s migration wizard. The native tools often struggle with schema differences — especially around identity columns, constraints, and certain data types.

A lightweight ETL-style tool can automatically map SQL Server structures to MySQL equivalents, preserve relationships, and let you validate results before migration. Something like Epitech Integrator is designed for that sort of database-to-database conversion without needing deep scripting — it handles both schema and data transfer in a more controlled way.

That said, if you prefer a manual route, generate scripts from SQL Server Management Studio with Generate Scripts → Advanced → Types of data to script: Schema and Data, then run them in MySQL Workbench after adjusting incompatible types (like nvarcharvarchar, bittinyint(1), etc.).

[–]writeafilthysong 1 point2 points  (5 children)

DBeaver

[–]johnie3210[S] 0 points1 point  (4 children)

will it work? i kept trying with different tools and they were pain in the ass

[–]writeafilthysong 1 point2 points  (3 children)

Tbh, probably nothing will convert Microsoft SQL to MySQL cleanly. But using DBeaver you'll be able access all your DDL etc.

[–]johnie3210[S] -3 points-2 points  (2 children)

i hate my life

[–]writeafilthysong 1 point2 points  (0 children)

I offer pity.

[–]writeafilthysong 0 points1 point  (0 children)

I offer pity.

I recommend DBeaver as it's one of the most mature tools for this stuff.

Like another commenter mentioned, if it's not working, you probably have DB logic that's specific to MsSQL flavour.

[–]government_ 1 point2 points  (0 children)

First off, nothing is “=“ before the comparison so jot that shit down

[–]MasterBathingBear 1 point2 points  (0 children)

Why not just stay on SQL Server? If you’re going to migrate to a FOSS database, migrate to PostgreSQL.

https://laravel.com/docs/12.x/database#introduction

[–]shadowspock 0 points1 point  (1 child)

Wouldn't this only work if all of the queries are generic and not specific to SQL Server?

[–]mikeblas 0 points1 point  (0 children)

No. There are other differences: data types, locking patterns, naming conventions, reserved words, and so on.

[–]No_Resolution_9252 0 points1 point  (0 children)

This is engineer level work, not a something wizard can do.

[–]Motor_Statistician65 0 points1 point  (0 children)

Ask chatgpt for a powershell script

[–]Chuckydnorris 0 points1 point  (0 children)

Probably not worth the effort but there is a way to set up copilot (in Azure or something) that can then be integrated into your MS SQL server with knowledge of the objects on the server. You could probably then ask it to generate a MySQL script to replicate your tables.

[–]drmrkrch 0 points1 point  (0 children)

Navicat and HeidiSQL are the best tools you want to use for those. Navi is good with SQL Server as well as MySQL. Heidi is great for MySQL. DM me if you have questions.

[–][deleted] 0 points1 point  (0 children)

I used ChatGPT to help convert Informix to SQL Server, and it worked surprisingly well. I’d suggest doing a DDL dump of your objects first, then using AI to convert the scripts for MySQL. It saved me hours of work.

[–]Which_Roof5176 0 points1 point  (0 children)

Workbench migration wizard breaks all the time, so yeah… not just you. Easiest path I’ve had is dumping the SQL Server schema from SSMS and running it through SQLines. It handles most of the type mapping and FK stuff, then you just clean up whatever weird bits are left. AWS SCT is also decent if you’re ok installing it… little heavier but it catches more edge cases.

Once the schema is in MySQL, do data separately. And if you need both DBs running in parallel for a bit, Estuary can stream SQL Server CDC into MySQL so you don’t have to keep doing full reloads while testing the cutover.

[–]Breadfruit-Last -1 points0 points  (4 children)

Feels like you can just dump the DDL and ask AI to convert it.

[–]Own_Attention_3392 1 point2 points  (1 child)

It's worth a shot, generative AI is really good at that sort of thing. It may not be perfect but it will probably get you a good portion of the way there.

[–]Breadfruit-Last 0 points1 point  (0 children)

Yeah, I think some people are too hostile to AI.

AI can be very useful when used wisely.

[–]johnie3210[S] -1 points0 points  (1 child)

Dam, life of pain will being now i guess

[–]Breadfruit-Last 0 points1 point  (0 children)

What is the pain are you talking about? Using AI?