Migrate Existing OnApp Database from MySQL to MariaDB, Percona Servers, or Percona Cluster
Install tool for OnApp database migration
- Skip the tool installation if OnApp Control Panel and MySQL Server run on the same box.
Install OnApp's YUM repository:
# rpm -Uvh http://rpm.repo.onapp.com/repo/onapp-repo.noarch.rpm
Install the onapp-mysql package:
# yum -y install onapp-mysql
Prepare OnApp to the migration
- Process with regular Control Panel upgrade to the most recent version.
Make sure you have no transactions and/or other tasks running.
Stop monit, onapp, httpd and crond services if your MySQL Server is installed outside of OnApp Control Panel box.
The migration tool will stop the
monit,
onapp, httpd
andcrond
services automatically if OnApp Control Panel and MySQL Server run on the same box.
Start the migration
Log via ssh as root into the box where MySQL server is installed.
Run the migration tool with -h option for options full list:
Run the migration as:
- CP and MySQL are the same box/onapp/onapp-mysql/onapp-db-migrate.sh --mariadb|--percona|--percona-cluster
- CP and MySQL are different boxes
/onapp/onapp-mysql/onapp-db-migrate.sh --mariadb|--percona|--percona-cluster --mysqlpasswd=MYSQL_PASSWORD
During the migration, the tool will:
CP and MySQL are the same box determine connection data to the MySQL server from
config/database.yml
check MySQL connection, and database presence
mysqld
service must be running during the migration- CP and MySQL are the same box stop
monit, onapp, httpd, crond
services - dump MySQL database (if
--skipdump
isn't used) - remove all MySQL related package (with
--nodeps rpm
option) - install one of chosen MariaDB, Percona Server or Percona Cluster using MySQL installer standalone
onapp-mysql.sh
- remove InnoDB logfiles
ib_logfile*
install the most recent packages
Please note,that we are not the packages' maintainer.The packages are provided by corresponding vendors. The following versions are used at the moment both for the RHEL/CentOS 5.x and 6.x.:
MariaDB Server - 5.5.47
Percona Server/Cluster - 5.6.27- start mysql service
check MySQL databases (with
mysqlcheck --all-databases --check-upgrade --auto-repai
r)update MySQL databases (with
mysql_upgrade
)stop
mysql
serviceremove InnoDB logfiles
ib_logfile*
configure the database server relatively to amount of available RAM, and put corresponding /etc/my.cnf or
/etc/my.cnf.d/server.cnf
start the
mysql
servicerestore the dump (if
--skipdump
isn't used)- CP and MySQL are the same box reconfigure the Monit services (to pick up new database server) using
onapp-cp-monit.sh
CP and MySQL are the same box start the
monit, crond, onapp
andhttpd
servicesset one of the
.maridb, .percona
or.percona-cluster
flags in the/onapp/onapp-mysql
if migration succeeded (to indicate proper database server usage every time OnApp is upgraded).
- There is no automated way to switch back to MySQL.
- All issues, which caused the migration failure, should be resolved manually.
- Please note to start all services if the migrate failed or CP and database are separate boxes
- The steps above are for existing OnApp installs only.