How To Update MariaDB

Hi!
I have recently seen that MariaDB 10.1 won’t be supported in Nextcloud 21.
I’m not an expert about the database and that is why I want your help to see how to update MariaDB 10.1 to the last version.
If you can show me a good tutorial I will be extremely happy!

Best regards,
Thanks in advance :wink:

On which OS is MariaDB running?

I’m on ubuntu 0.18.04.1 LTS

There is a pretty straightforward guide on the MariaDB website. Basically all you have to do is uninstall MariaDB 10.1, add their apt package repository, install MariaDB 10.5 and then upgrade the data directory.

https://mariadb.com/docs/deploy/upgrade-community-server-cs105-ubuntu18/

…and make sure you have backups before you start! :wink:

Hope that helps.

3 Likes

yup as @bb77 says follow the instructions that mariaDB supply.
i don’t really like their model which has you uninstalling the older version then installing the newer version rather than just upgrading but it works. a lot of people will be asking this as the default versions in many OS repos are quite old.

I hope that will correctly work and don’t brock my nextcloud ^^’

If you follow the instructions it should work flawlessly. But it’s always a good thing to have backups, just in case… Can’t say that enough :wink:

I’ve finally decided to update MariaDB but I’m really fear to do that x). So when I try to do the first command to take backup:
sudo mariabackup --backup --user=user --password=*** --target-dir=/home/me/mariadb_backup
I have an error that indicates me that I need to use --backup_encrypted instead --backup. And when I do this commanded it works without any error. But then, when I try to use this command:
sudo mariabackup --prepare --target-dir=/home/me/mariadb_backup

I have this error :

mariabackup: Error: cannot open ./xtrabackup_checkpoints
mariabackup: Error: failed to read metadata from ./xtrabackup

Unfortunately I can’t help with that. I am not familiar with the mariadb backup tool. I use mysqldump to backup my database, as described here:

https://docs.nextcloud.com/server/20/admin_manual/maintenance/backup.html#mysql-mariadb

mysqldump --single-transaction -h [server] -u [username] -p[password] [db_name] > nextcloud-sqlbkp_`date +"%Y%m%d"`.bak