Add to Favourites Add to Favourites    Print this Article Print this Article

Converting from MySQL 5.5 to MariaDB 5.5

If you're running MySQL 5.5 and wish to convert to MariaDB 5.5 (which then allows a higher MariaDB later on), then you can do the following:
  1. Make full DA User backups, and .sql backups before you do anything else.  Ensure the backups are ok and ready for restore, in case anything goes wrong.   To create the .sql backups, type:

    cd /usr/local/directadmin/custombuild
    ./build set mysql_backup yes
    ./build mysql_backup
    #wait for the backup to complete, then rename it to a unique folder so it's not overwritten:
    mv mysql_backups mysql_backups.`date +%F`
    ./build set mysql_backup no

  2. next, we'll make a copy of the /var/lib/mysql folder (/home/mysql on Debian/FreeBSD).  We'll stop mysqld first, to avoid corruption during the copy.

    perl -pi -e 's/mysqld=ON/mysqld=OFF/' /usr/local/directadmin/data/admin/services.status
    service mysqld stop
    cd /var/lib
    cp -Rp mysql mysql.conversion_backup

  3. The actual swap of rpms must partially be done manually.  Remove the MySQL rpms:

    rpm -e `rpm -qa | grep MySQL`

  4. The current state, we have data for 5.5 and no binaries/libraries installed.   Install MariaDB:

    ./build set mariadb 5.5
    ./build set mysql_inst mariadb
    ./build mariadb

  5. Recompile anything that uses, mainly just php:

    ./build php n

  6. Enable backups for future updates, and mysqld monitoring again:

    perl -pi -e 's/mysqld=OFF/mysqld=ON/' /usr/local/directadmin/data/admin/services.status
    ./build set mysql_backup yes

Check over everything to ensure it's running correctly.  If not, going back to MySQL 5.5 would use roughly the same procedure.

Now that you're in the MariaDB family, you can upgrade to 10.0 or 10.1 from 5.5.
I do not recommend going directly from MySQL 5.5 to MariaDB 10.x, even though it might work.

Rules for versions

Please see the MariaDB Documentation on upgrading from MySQL to MariaDB to ensure the value you're converting to is supported, based on your current version's data.


Was this answer helpful?

Also Read