Marcel Piquet
Marcel Piquet

Reputation: 168

Migrate large database from MySQL 8 to MariaDB

I need a solution to migrate a large database from MYSQL 8 to MariaDB (any version, but preferably 10.4)
I have already searched the MariaDB site and I have done Google searches on the subject but I have not found anything yet.
Unfortunately, the solution to run a mysqldump seems to me not very feasible, because the database that I have to migrate is at least 40 GB large (of physical disk space).

Upvotes: 2

Views: 5375

Answers (2)

Rick James
Rick James

Reputation: 142278

Plan A:

mysqldump -h mysql_8_host ... | mysql -h mariadb_10_host ...

That avoids instantiating the intermediate file that you say might be 160GB.

Plan B:

mysqldump -h mysql_8_host ... | gzip >dump.gz
gunzip <dump.gz | mysql -h mariadb_10_host ... 

The compressed file will probably be less than 40GB. For one thing, it will not have the indexes. (They will be rebuilt in the second step.)

In either case...

There may be incompatibilities between the two versions. Check out the parameters of both mysql's mysqldump, which might have backward-compatibility options, and mariadb's mysqldump, which might be prepared to accept 8.0 input.

Upvotes: 1

Hermsi1337
Hermsi1337

Reputation: 251

In general MariaDB is designed as a drop-in replacement for MySQL.

Since MySQL 8.0 it's unfortunately not possible anymore to simply replace MySQL with MariaDB and use the same data-files as before.

The only way to move to MariaDB from MySQL 8.0 or higher is using mysqldump.

See here for reference: https://mariadb.com/kb/en/upgrading-from-mysql-to-mariadb/

If you are using MySQL 8.0 or above, you have to use mysqldump to move your database to MariaDB.

Another solution that came to my mind was downgrading from MySQL 8.0 to MySQL 5.7 - unfortunately that is not possible either:

Downgrade from MySQL 8.0 to MySQL 5.7, or from a MySQL 8.0 release to a previous MySQL 8.0 release, is not supported. The only supported alternative is to restore a backup taken before upgrading. It is therefore imperative that you backup your data before starting the upgrade process.

https://dev.mysql.com/doc/refman/8.0/en/downgrading.html

I think you have to take the time for a mysqldump.

Sorry m8.

Upvotes: 3

Related Questions