Mysqldump: Use the version you want to import into

Other posts about mysqldump

Our colleagues over at maxcluster told us a while ago, that the best way to migrate a (My)SQL or database or MaraDB ist to use the mysqldump tool which comes with the server we want to import into. They are normally most compatible to each other and can read most of the other databases.

Today my colleague Carl and me wanted to migrate a MariaDB 10.5.23 into a MySQL 8 ddev container. It took nearly half a day and we learned a ton.

Thankfully we already learned last time to properly setup an SSH tunnel for the dump, you can find the other mysql dump posts above in the list.

Make sure your SQL dump does what you expect

Don’t add stupid parameters to mysqldump or miss important

  1. Don’t use --compact or -c because it strips all comments, especially the DISABLE KEYS comments
  2. Because we wanted to change a column from longtext to json, we spotted a problem with our GDPR mysqldump – a missing --no-create-info created a second CREATE TABLE in our script – whoops.

Use the right version ?

All the time we assumed, that we are running a Mysql mysqldump version inside an mysql ddev container. But I learned today, that it seems in the past ddev used always MariaDB because they were pretty compatible to each other, but this changed a couple of weeks ago.

So we learned, that due to the ddev version we used, it contained not only an old version, but not even MySQL (we don’t blame ddev here at all! Know the tools you use ?)

And as expected using the right version and the right parameter just worked out <3

One thought on “Mysqldump: Use the version you want to import into

Leave a Reply