Migration from MySQL to MariaDB

Hey there,

I was reading about MariaDB, about if its worth it here and the way to migrate from MySQL by the official guide here.

As my system is so far just used by myself and I do not depend too much on it and like to fickle and try, I decided that it’s the best time to switch now, better than later, when I start to share my Nextcloud to friends and family.

I just wanted to ask, if the migration really works that smooth, especially in combination with Nextcloud. Just uninstall mysql-server and I guess also mysql-server-5.5 as actual server pachage and then install mariadb-server? I did not found some i.e. PHP module for MariaDB, so I guess the PHP MySQL module will work also for MariaDB, as also other related pieces of software will?

My Nextcloud 11 runs on a Raspberry Pi 2 with current Raspbian LAMP (Apache 2.4.23, MySQL 5.5.53, PHP 7.0.14)

The current Raspbian package of mariadb-server depends on mariadb-server-10.0, but there is also mariadb-server-5.5 which looks like the closer upgrade for my mysql-server-5.5. I was reading here that upgrading from MariaDB 5.5 to 10 should work without problems. So is it also safe to migrate from MySQL 5.5 directly to MariaDB 10, or should I better choose MariaDB 5.5 first and then jump to 10 on a second step?

Are there any specific recommendations about changing parameters in my.cnf for Nextcloud?

Thanks very much and happy migration to new year :slight_smile: .

Thanks for the advice. Worked flawlessly:

  1. Database backup
  2. occ maintenance --on
  3. service mysql stop
  4. apt-get remove mysql-server & apt-get autoremove (mysql-server-5.5, …)
  5. apt-get install mariadb-server with current dependencies (mariadb-server-10.0, …)
  6. occ maintenance --off

Nextcloud starts without any errors beside:

Fatal webdav Sabre\DAV\Exception\ServiceUnavailable: HTTP/1.1 503 System in maintenance mode.

Maybe this could be changed from Fatal to Info as it is totally expected during maintenance mode :wink: .

I switched from mysql to maria a good while back, though as I run containers on my hardware I spun up a new 16.04 container, installed maria, exported and imported dbs, stopped the mysql container, set the ip on maria to that of the old one, ensured external access was permitted and it all worked fine. Quite a bit more work than a simple uninstall/install and a good few more services other than NC to worry about but it was all straightforward.

I’m very happy with the switch, I trust you will be too!

So far from the practical point of view, I don’t feel any difference. Was playing around with files, contacts etc. and feels like before. But I did no benchmark or something ;).

But as mysql is owned by oracle and mariadb is the related open source fork, I guess being on the right side now of faster development etc. I always wonder companies, especially oracle, buy open source projects and let them die. Same with OpenOffice:

  • Grabbed by oracle
  • LibreOffice fork by most developers and community as ongoing open source.
  • OpenOffice development extremely slow and finally stopped by oracle…

Haha I found out now that the license was sold to Apache and therefore Apache OpenOffice exists. But seems to develop also extremely slow by just one minor version every year Oo…

1 Like

Same reasons I switched :slight_smile:

Is this still working? NC 21 will require mySQL 8, but the default database on Debian is MariaDB. That means many will have to migrate from mySQL 5.x to MariaDB 10.3. I worry that there might be lots of loss of data.

At least create a database dump first to be able to restore, if anything does not migrate well:

mysqldump --all-databases > /path/to/backup.sql

For me, this worked very nicely:

Debian 10, NC 20.05, switching from mySQL 5.7 to MariaDB 10.3:

cd /var/www/nextcloud
sudo -u www-data php occ maintenance:mode --on

as root:

apt-get install mariadb-server

stop being root

sudo -u www-data php occ maintenance:mode --off

so far everything is fine.

Thank you for the advice!