MySQL to MariaDBand Back Again - Percona...11 Step 0: Backup! Step -1: Check yoself •Partition...
Transcript of MySQL to MariaDBand Back Again - Percona...11 Step 0: Backup! Step -1: Check yoself •Partition...
![Page 1: MySQL to MariaDBand Back Again - Percona...11 Step 0: Backup! Step -1: Check yoself •Partition space is important df; df–I Step 0.1: Full dumpsofyourdatabase (scheme optional)](https://reader034.fdocuments.us/reader034/viewer/2022051907/5ffab072ef883a0a490214b1/html5/thumbnails/1.jpg)
MySQL to MariaDB and Back Again
benny Vasquez -- cPanel, Inc.Santa Clara, California | April 23th – 25th, 2018
![Page 2: MySQL to MariaDBand Back Again - Percona...11 Step 0: Backup! Step -1: Check yoself •Partition space is important df; df–I Step 0.1: Full dumpsofyourdatabase (scheme optional)](https://reader034.fdocuments.us/reader034/viewer/2022051907/5ffab072ef883a0a490214b1/html5/thumbnails/2.jpg)
2
hi, I'm benny.
![Page 3: MySQL to MariaDBand Back Again - Percona...11 Step 0: Backup! Step -1: Check yoself •Partition space is important df; df–I Step 0.1: Full dumpsofyourdatabase (scheme optional)](https://reader034.fdocuments.us/reader034/viewer/2022051907/5ffab072ef883a0a490214b1/html5/thumbnails/3.jpg)
3
right now
![Page 4: MySQL to MariaDBand Back Again - Percona...11 Step 0: Backup! Step -1: Check yoself •Partition space is important df; df–I Step 0.1: Full dumpsofyourdatabase (scheme optional)](https://reader034.fdocuments.us/reader034/viewer/2022051907/5ffab072ef883a0a490214b1/html5/thumbnails/4.jpg)
4
before cPanel
![Page 5: MySQL to MariaDBand Back Again - Percona...11 Step 0: Backup! Step -1: Check yoself •Partition space is important df; df–I Step 0.1: Full dumpsofyourdatabase (scheme optional)](https://reader034.fdocuments.us/reader034/viewer/2022051907/5ffab072ef883a0a490214b1/html5/thumbnails/5.jpg)
5
boring
![Page 6: MySQL to MariaDBand Back Again - Percona...11 Step 0: Backup! Step -1: Check yoself •Partition space is important df; df–I Step 0.1: Full dumpsofyourdatabase (scheme optional)](https://reader034.fdocuments.us/reader034/viewer/2022051907/5ffab072ef883a0a490214b1/html5/thumbnails/6.jpg)
6
boring
![Page 7: MySQL to MariaDBand Back Again - Percona...11 Step 0: Backup! Step -1: Check yoself •Partition space is important df; df–I Step 0.1: Full dumpsofyourdatabase (scheme optional)](https://reader034.fdocuments.us/reader034/viewer/2022051907/5ffab072ef883a0a490214b1/html5/thumbnails/7.jpg)
7
enough about me, though
![Page 8: MySQL to MariaDBand Back Again - Percona...11 Step 0: Backup! Step -1: Check yoself •Partition space is important df; df–I Step 0.1: Full dumpsofyourdatabase (scheme optional)](https://reader034.fdocuments.us/reader034/viewer/2022051907/5ffab072ef883a0a490214b1/html5/thumbnails/8.jpg)
Migrating your data safely
![Page 9: MySQL to MariaDBand Back Again - Percona...11 Step 0: Backup! Step -1: Check yoself •Partition space is important df; df–I Step 0.1: Full dumpsofyourdatabase (scheme optional)](https://reader034.fdocuments.us/reader034/viewer/2022051907/5ffab072ef883a0a490214b1/html5/thumbnails/9.jpg)
Migrating your data safelySTOP
![Page 10: MySQL to MariaDBand Back Again - Percona...11 Step 0: Backup! Step -1: Check yoself •Partition space is important df; df–I Step 0.1: Full dumpsofyourdatabase (scheme optional)](https://reader034.fdocuments.us/reader034/viewer/2022051907/5ffab072ef883a0a490214b1/html5/thumbnails/10.jpg)
10
Step 0: Backup!
![Page 11: MySQL to MariaDBand Back Again - Percona...11 Step 0: Backup! Step -1: Check yoself •Partition space is important df; df–I Step 0.1: Full dumpsofyourdatabase (scheme optional)](https://reader034.fdocuments.us/reader034/viewer/2022051907/5ffab072ef883a0a490214b1/html5/thumbnails/11.jpg)
11
Step 0: Backup!Step -1: Check yo self• Partition space is important
df ; df –I
Step 0.1: Full dumps of your database (scheme optional)• Use mysqldump
[root: ~]# mysqldump -u root -p mysql user > `date +%Y%m%d`.user_table_dump.sql[root: ~]# mysqldump -u root -p --all-databases --skip-lock-tables > `date +%Y%m%d`.alldb.sql
Step 0.2: backup of the folder(s) and configurations• Use cp, rsync, etc- cp -a /var/lib/mysql{,.back. `date +%Y%m%d`} ; cp -a /etc/my.cnf{,.back.`date +%Y%m%d`}
Step 0.3: full server backups• Wherever possible, hot-spare is your best bet.
![Page 12: MySQL to MariaDBand Back Again - Percona...11 Step 0: Backup! Step -1: Check yoself •Partition space is important df; df–I Step 0.1: Full dumpsofyourdatabase (scheme optional)](https://reader034.fdocuments.us/reader034/viewer/2022051907/5ffab072ef883a0a490214b1/html5/thumbnails/12.jpg)
The Environment(s)Let’s get on the same page
![Page 13: MySQL to MariaDBand Back Again - Percona...11 Step 0: Backup! Step -1: Check yoself •Partition space is important df; df–I Step 0.1: Full dumpsofyourdatabase (scheme optional)](https://reader034.fdocuments.us/reader034/viewer/2022051907/5ffab072ef883a0a490214b1/html5/thumbnails/13.jpg)
13
Env{1}
* CentOS 6.9
* Installed MySQL 5.5
* Installed Apache & PHP
* Added WordPress Site
The Environment(s)
Env{2}
* CentOS 6.9
* Installed cPanel & WHM
* installed w/MySQL 5.5
* Added WordPress Site
![Page 14: MySQL to MariaDBand Back Again - Percona...11 Step 0: Backup! Step -1: Check yoself •Partition space is important df; df–I Step 0.1: Full dumpsofyourdatabase (scheme optional)](https://reader034.fdocuments.us/reader034/viewer/2022051907/5ffab072ef883a0a490214b1/html5/thumbnails/14.jpg)
MySQL à MariaDBFo’ reals this time.
![Page 15: MySQL to MariaDBand Back Again - Percona...11 Step 0: Backup! Step -1: Check yoself •Partition space is important df; df–I Step 0.1: Full dumpsofyourdatabase (scheme optional)](https://reader034.fdocuments.us/reader034/viewer/2022051907/5ffab072ef883a0a490214b1/html5/thumbnails/15.jpg)
15
6 easy steps• Install the MariaDB repos
https://mariadb.com/kb/en/library/yum/• Stop MySQL and remove it
service mysqld stop; yum remove mysql-community-server• Install MariaDB with your package manager
yum install MariaDB-server MariaDB-client • Ensure MariaDB is running
service mysql startmysql -Vservice mysql status
• Run mysql_upgradeFinish the conversion
Things to keep in mind• Migrate to the same version
- MySQL 5.1 -> MariaDB 5.1- MySQL 5.5 -> MariaDB 5.5
- MySQL 5.6 -> MariaDB 10.0- MySQL 5.7 -> MariaDB 10.2
MySQL to MariaDB; Env{1} Great Success
Env{1}: Success
![Page 16: MySQL to MariaDBand Back Again - Percona...11 Step 0: Backup! Step -1: Check yoself •Partition space is important df; df–I Step 0.1: Full dumpsofyourdatabase (scheme optional)](https://reader034.fdocuments.us/reader034/viewer/2022051907/5ffab072ef883a0a490214b1/html5/thumbnails/16.jpg)
16
3 easy steps• Navigate to MySQL/MariaDB Upgrade• Acknowledge the warnings• Click continue
MySQL to MariaDB; Env{2} Great Success
Env{2}: Success
![Page 17: MySQL to MariaDBand Back Again - Percona...11 Step 0: Backup! Step -1: Check yoself •Partition space is important df; df–I Step 0.1: Full dumpsofyourdatabase (scheme optional)](https://reader034.fdocuments.us/reader034/viewer/2022051907/5ffab072ef883a0a490214b1/html5/thumbnails/17.jpg)
MariaDB à MySQL under 5.6Easy peasy
![Page 18: MySQL to MariaDBand Back Again - Percona...11 Step 0: Backup! Step -1: Check yoself •Partition space is important df; df–I Step 0.1: Full dumpsofyourdatabase (scheme optional)](https://reader034.fdocuments.us/reader034/viewer/2022051907/5ffab072ef883a0a490214b1/html5/thumbnails/18.jpg)
18
6 easy steps• Stop MariaDB
service mysql stop • Remove MariaDB and its repos
yum remove MariaDB-server MariaDB-client • Install MySQL• Ensure MySQL is running• mysql_upgrade
Things to keep in mind• Migrate to the same version
- MariaDB 5.1 -> MySQL 5.1- MariaDB 5.5 -> MySQL 5.5
MariaDB to MySQL, when < 5.6 Env{1} Great Success
Env{1}: Success
![Page 19: MySQL to MariaDBand Back Again - Percona...11 Step 0: Backup! Step -1: Check yoself •Partition space is important df; df–I Step 0.1: Full dumpsofyourdatabase (scheme optional)](https://reader034.fdocuments.us/reader034/viewer/2022051907/5ffab072ef883a0a490214b1/html5/thumbnails/19.jpg)
19
2 easy steps• Manually adjust the mysql-version in /var/cpanel/cpanel.config
[root: ~]# grep mysql-version /var/cpanel/cpanel.configmysql-version=5.5
• Tell cPanel to check the installed RPMs and fix any problems it encounters/scripts/check_cpanel_rpms targets=MySQL55,MySQL56,MySQL57,MariaDB100 --fix
Env{2}: Success
MariaDB to MySQL, when < 5.6 Env{2} Great Success
![Page 20: MySQL to MariaDBand Back Again - Percona...11 Step 0: Backup! Step -1: Check yoself •Partition space is important df; df–I Step 0.1: Full dumpsofyourdatabase (scheme optional)](https://reader034.fdocuments.us/reader034/viewer/2022051907/5ffab072ef883a0a490214b1/html5/thumbnails/20.jpg)
MariaDB à MySQL over 5.6ugh
![Page 21: MySQL to MariaDBand Back Again - Percona...11 Step 0: Backup! Step -1: Check yoself •Partition space is important df; df–I Step 0.1: Full dumpsofyourdatabase (scheme optional)](https://reader034.fdocuments.us/reader034/viewer/2022051907/5ffab072ef883a0a490214b1/html5/thumbnails/21.jpg)
21
7 easy steps• DUMP. YOUR. DATABASES. And privileges.• Stop MariaDB
service mysql stop • Remove your databases
cp -a /var/lib/mysql{,.bak}; rm -rf /var/lib/mysql; chown mysql. /var/lib/mysql• Remove MariaDB and its repos
yum remove MariaDB-server MariaDB-client • Install MySQL
- Grab the community repo, and then yum install ithttps://dev.mysql.com/doc/mysql-installation-excerpt/5.7/en/linux-installation-yum-repo.html
• Ensure MySQL is runningservice mysql status
• Restore your databases- If you’ve done good, beer.
Warning: swapping in place WILL corrupt your databases
MariaDB to MySQL, when ≥ 5.6 Env{1} eh Success
Env{1}: Success?
![Page 22: MySQL to MariaDBand Back Again - Percona...11 Step 0: Backup! Step -1: Check yoself •Partition space is important df; df–I Step 0.1: Full dumpsofyourdatabase (scheme optional)](https://reader034.fdocuments.us/reader034/viewer/2022051907/5ffab072ef883a0a490214b1/html5/thumbnails/22.jpg)
22
6 easy steps• DUMP. YOUR. DATABASES. And privileges.• Remove your database files
cp -a /var/lib/mysql{,.bak}; rm -rf /var/lib/mysql; chown mysql. /var/lib/mysql
• Manually adjust the mysql-version in /var/cpanel/cpanel.config[root: ~]# grep mysql-version /var/cpanel/cpanel.config
mysql-version=5.7
• Tell cPanel to check the installed RPMs and fix any problems it encounters/scripts/check_cpanel_rpms –fix
• Ensure MySQL is runningservice mysql status
• Restore your databases- Also earns beer.
Warning: ”downgrading” in place WILL corrupt your databases, and WILL increase headaches.
MariaDB to MySQL, when ≥ 5.6 Env{2} eh Success
Env{2}: Success?
![Page 23: MySQL to MariaDBand Back Again - Percona...11 Step 0: Backup! Step -1: Check yoself •Partition space is important df; df–I Step 0.1: Full dumpsofyourdatabase (scheme optional)](https://reader034.fdocuments.us/reader034/viewer/2022051907/5ffab072ef883a0a490214b1/html5/thumbnails/23.jpg)
Conclusions and take-awaysugh
![Page 24: MySQL to MariaDBand Back Again - Percona...11 Step 0: Backup! Step -1: Check yoself •Partition space is important df; df–I Step 0.1: Full dumpsofyourdatabase (scheme optional)](https://reader034.fdocuments.us/reader034/viewer/2022051907/5ffab072ef883a0a490214b1/html5/thumbnails/24.jpg)
24
ugh.
• If you can, avoid changes after 5.7/10.2• Test, tinker, make notes• Be prepared for the suck, and maybe you’ll have over estimated.• Always reward yourself.
![Page 25: MySQL to MariaDBand Back Again - Percona...11 Step 0: Backup! Step -1: Check yoself •Partition space is important df; df–I Step 0.1: Full dumpsofyourdatabase (scheme optional)](https://reader034.fdocuments.us/reader034/viewer/2022051907/5ffab072ef883a0a490214b1/html5/thumbnails/25.jpg)
25
![Page 26: MySQL to MariaDBand Back Again - Percona...11 Step 0: Backup! Step -1: Check yoself •Partition space is important df; df–I Step 0.1: Full dumpsofyourdatabase (scheme optional)](https://reader034.fdocuments.us/reader034/viewer/2022051907/5ffab072ef883a0a490214b1/html5/thumbnails/26.jpg)
Thank [email protected]
LAMP installation, to build your envmysqldump, for your backups
Install MySQL 5.7 on your servercPanel docs for upgrade
scheme optional
https://go.cpanel.net/pl18
![Page 27: MySQL to MariaDBand Back Again - Percona...11 Step 0: Backup! Step -1: Check yoself •Partition space is important df; df–I Step 0.1: Full dumpsofyourdatabase (scheme optional)](https://reader034.fdocuments.us/reader034/viewer/2022051907/5ffab072ef883a0a490214b1/html5/thumbnails/27.jpg)
27
Rate My Session