• Our team is looking to connect with folks who use email services provided by Plesk, or a premium service. If you'd like to be part of the discovery process and share your experiences, we invite you to complete this short screening survey. If your responses match the persona we are looking for, you'll receive a link to schedule a call at your convenience. We look forward to hearing from you!
  • The BIND DNS server has already been deprecated and removed from Plesk for Windows.
    If a Plesk for Windows server is still using BIND, the upgrade to Plesk Obsidian 18.0.70 will be unavailable until the administrator switches the DNS server to Microsoft DNS. We strongly recommend transitioning to Microsoft DNS within the next 6 weeks, before the Plesk 18.0.70 release.
  • The Horde component is removed from Plesk Installer. We recommend switching to another webmail software supported in Plesk.

Contribution TUTORIAL: downgrade MariaDB 10.2 to MariaDB 10.1

B4c4rd1

Regular Pleskian
Hello everybody,

I introduce you here a tutorial on how to downgrade MariaDB on a livesystem.

The tutorial will not be perfect, but they are all cordially invited to improve it.

Tested with Ubuntu 16.04 and Plesk Onyx 17

If you have added MariaDB via APT, you must delete the source to MariaDB 10.2:
Code:
add-apt-repository --remove 'deb [arch=amd64,i386,ppc64el] http://ftp.hosteurope.de/mirror/mariadb.org/repo/10.2/ubuntu xenial main'

Now you add the MariaDB 10.1 APT source:
Code:
apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 0xF1656F24C74CD1D8
add-apt-repository 'deb [arch=amd64,i386,ppc64el] http://ftp.hosteurope.de/mirror/mariadb.org/repo/10.1/ubuntu xenial main'

Update APT:
Code:
apt update

Now create a database Backup:
Code:
MYSQL_PWD=`cat /etc/psa/.psa.shadow` mysqldump -u admin --add-drop-table --routines --events --all-databases --force > data-for-downgrade.sql
MYSQL_PWD=`cat /etc/psa/.psa.shadow` mysql -u admin --execute="SET GLOBAL innodb_fast_shutdown=0"

Now stop mysql
Code:
service mysql stop

Create a backup from your MySQL lib (If something goes wrong and you have to reinstall MariaDB 10.2.):
Code:
mv /var/lib/mysql{,.bak}

Now install MariaDB 10.1 (If an error occurs, run the following command again).
Please confirm the root password without input with enter:
Code:
apt-get install --purge mariadb-client-10.2- mariadb-client-core-10.2- mariadb-server-10.2- mariadb-server-core-10.2- mariadb-client-10.1 mariadb-client-core-10.1 mariadb-server-10.1 mariadb-server-core-10.1 libmariadbclient18 libjemalloc1 libmysqlclient18

Restore backup (Enter the previously entered MySQL password. In this case simply press enter):
Code:
mysql -u root -p --force < data-for-downgrade.sql

Login to MySQL (Enter the previously entered MySQL password. In this case simply press enter):
Code:
mysql -uroot -p mysql

Check Users:
Code:
select host, user, password from mysql.user;

Output:
Code:
+-----------+------------------+-------------------------------------------+
| host      | user             | password                                  |
+-----------+------------------+-------------------------------------------+
| localhost | pma_XXX| XXX |
| localhost | apsc             | XXX |
| localhost | roundcube        | XXX |
| localhost | debian-sys-maint | XXX |
| localhost | admin            | XXX |
+-----------+------------------+-------------------------------------------+

If you see your old users, then flush privileges:
Code:
FLUSH PRIVILEGES;
quit;

All done!

Please test this before in a VM with your configuration. I hope this will help some.
 
I will do that. Thanks for your message :)

I have done more tests. After the downgrade, a mysql error can occur if the variable binlog format was not set to MIXED in my.cnf. Since the default is set to STATEMENT at mariaDB 10.1.
 
Back
Top