Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Migrating from MySQL to MariaDB and viceversa

Tags:

mysql

mariadb

I am doing a research regarding migrating from MySQL to MariaDB and viceversa.

As it seems, the first part should be easy and not complicated as stated here: MariaDB versus MySQL - Compatibility

It is the "viceversa" part that botters me: MariaDB -> MySQL. I just could not find anything useful about this topic.

Can anyone help? Any advice, hint? Are there complications migrating from MariaDB back to MySQL?

Thank you so much.

like image 825
AlexRebula Avatar asked Nov 22 '11 08:11

AlexRebula


People also ask

Can I migrate from MySQL to MariaDB?

The existing Databases of MySQL need to be backed up to be transferred from MySQL to MariaDB. The command mysqldump can be used to export all the existing databases in the form of files. Binary Logging is required for this command to work, and this can be enabled in the MySQL configurations by modifying my.

How do I change MySQL database to MariaDB?

To do this, download the MariaDB source tarball; compile and install the binary; create users, directories, and the init file; set permissions; start MariaDB; check that both MySQL and MariaDB are running; and then start moving stuff.

Is MariaDB better than MySQL?

When it comes to performing queries or replication, MariaDB is faster than MySQL. So if you need a high-performance relational database solution, MariaDB is a good choice. In addition, MariaDB also easily supports a high concurrent number of connections without much performance degradation.


2 Answers

If there is someone who should ever take care of migrating from MariaDB to MySQL, it would be Oracle. As Oracle pretends MariaDB does not exist (company politics-policies) , it also does not provide the possibility to migrate (which does not bother me personally, because being on MariaDB team I'd prefer people to chose it and stay there :)

Having said all the above, the migration should be straightforward, provided you do not use special features (so, no storage engines besides MyISAM/Innodb). You shutdown MariaDB, you save the data directory, remove MariaDB, install MySQL, copy the saved data directory back. In the worst case you'd need to remove parameters from my.ini/my.cnf that are not recognized by MySQL.

The point I'm trying to make is since persistent data formats for most commonly used storage engines are compatible, no data migration is required (at least not yet:)

like image 192
Vladislav Vaintroub Avatar answered Oct 01 '22 10:10

Vladislav Vaintroub


It's very easy ton migrate Mysql to MariaDB (so, no storage engines besides MyISAM/Innodb).

  1. Backup your database
  2. Stop mysql server
  3. Set your repositorie (http://downloads.mariadb.org/mariadb/repositories/), it's depend on your linux stack.
  4. Execute commande line to install MariaDB.

But now migrate MariaDB to Mysql is more difficult. I have no solution yet for this operation. Since my last try i have crashed my server...

like image 30
Aurélien Avatar answered Oct 01 '22 10:10

Aurélien