Well, upgrading MySQL to MariaDB in this case is just installing MariaDB and stopping your MySQL service. Maybe it’ might seem strange but MariaDB is a “drop-in” replacement for MySQL. The differences will increase with time, but as of now, there’s nothing to do, other than stopping MySQL and installing MariaDB.
Steps to install MariaDB
Make sure your package manager has access to MariaDB.
sudo apt-get install software-properties-common
sudo apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 0xF1656F24C74CD1D8
sudo add-apt-repository 'deb [arch=amd64,arm64,ppc64el] http://suro.ubaya.ac.id/mariadb/repo/10.3/ubuntu bionic main'
sudo apt-get update
sudo service mysql stop
Now install MariaDB, which will be launched upon completion
apt install mariadb-server
That’s it. Have fun.