switch from mysql to mariadb

  • Hi guys,


    I'm trying to switch from mysql to mariadb.


    It seems that this previously was possible via:


    Code
    1. perl imscp-autoinstall -r sql

    but the installer only offers me mysql und remote server as option (see screenshot)



    Has support for mariadb been removed or what am I doing wrong?


    I'm on ubuntu 16.04 and imscp 1.3.1

  • This is because you cannot simply switch from mysql 5.7 to mariadb without migrating your data. Here you need to switch manually.

  • This is because you cannot simply switch from mysql 5.7 to mariadb without migrating your data. Here you need to switch manually.

    Can you please help me with the necessary steps?


    1. mysqldump all databases
    2. uninstall all mysql packages via apt
    3. install mariadb packages via apt
    4. import mysqldump backup
    5. rerun installer


    Did I miss something?

  • @ezafiro


    First, I would recommend to wait i-MSCP 1.3.4 because there is some problems with your current version (up to 1.3.3)... Then after, you'll have to:

    • Dump all your databases
    • Uninstall all mysql packages via apt
    • Install mariadb packages via apt
    • Import your databases
    • Edit the /etc/imscp/imscp.conf file to change the SQL_SERVER parameter value according the mariadb version you use (for instance mariadb_10.0)
    • Rerun installer

    Be aware that system tables for mysql are not same as system table for mariadb... Don't forgot to make a backup of all your data before starting playing.

    badge.php?id=1239063037&bid=2518&key=1747635596&format=png&z=547451206

  • What I have tried:

    Code
    1. # uninstall mysqlservice mysql stopapt-get purge mysql-server mysql-common mysql*apt-get autoclean; sudo apt-get clean; sudo apt-get autoremove;rm -R /etc/mysql/rm -R /var/lib/mysql/# install maria dbapt-get install mariadb-server


    Then I restored the backup (not backed up mysql, sys, information_schema tables)
    I edited /etc/imscp/imscp.conf and set SQL_SERVER to mariadb_10.0 (using 10.0.27-MariaDB-0ubuntu0.16.04.1)


    Then I rerun installer



    Code
    1. perl imscp-autoinstall -r sql

    but installer still offers me only to install mysql5.7 and remote server :-/




    What Am I missing?

  • I fixed this issue by deleting imscp.conf and imscp.conf.old and then rerun

    Code
    1. perl imscp-autoinstall -d


    but now I noticed, that the installer doesn't seem to recreate the mysql users :-/
    Is there any hidden flag or any script available to regenerate mysql users from imscp database?

  • Migration finally succeed, I just drop the php-script I used to rebuild the sql permessions:


    Edited once, last by ezafiro ().