MySql: Combining server, migrating, upgrading, and changing db engine with minimum down time
Linux - ServerThis forum is for the discussion of Linux Software used in a server related context.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
MySql: Combining server, migrating, upgrading, and changing db engine with minimum down time
Dear all,
Currently we have two production servers that run MySQL 5.0.77. Those two servers contain databases that use MYISAM as database engine. One server has approx 60 GB of data and 20 GB for the other.
Some time ago, we've purchased a new server that we want to use as our new production server. What we want/need/plan to do for our NEW server are:
Combines those two old servers into one new server.
Upgrade our beloved MySQL 5.0.77 to Maria-db 10.
Change database engine from ISAM to INNODB.
Our current option is dump everything and restore all to our new server as INNODB in Maria-db. But from our simulation, processes will cost us roughly 16 hours (5 GB of data cost us around 30 minutes with innodb_doublewrite=0).
My question is, how can we do those three tasks with as minimum down time as possible?
Any help appreciated...
Location: Northeastern Michigan, where Carhartt is a Designer Label
Distribution: Slackware 32- & 64-bit Stable
Posts: 3,541
Rep:
What I would do is set your new server up from scratch (does it already have MariaDB on it?).
Get the schema for the two data bases, not an unload, just the schema and copy them over to the new server. Make sure you specify INNODBm, and, without knowing where you are, think about UTF-8 (particularly if you have accented characters in your data).
Check your configuration files in /etc/my.cnf.d on the new server, make sure you've got your options set properly.
Take a look at your schema files. Do you have tons of indexes? Particularly unique indexes? If so, yank all the indexes out of the schema into a separate file. Do the same if you have stored procedures or triggers; into a separate file.
Your data will load much, much faster without the indexes (particularly unique indexes), ditto for any stored procedures or triggers.
Build the data bases using the schema files (without indexes, etc.).
All that can be done before you do anything else.
Now you need to get your data off the existing server. You can use mysqldump (or whatever utility you want), read though the manual page for options (one of which will be do not generate the schema). All you want is data, nothing else.
Copy the data files to your new server, load them (it's going to load really quickly).
Add the indexes, then add the stored procedures and triggers (if any).
It's not going to take any 15+ hours to do this, more like a couple. The indexes will build quickly also (and, it's the indexes that are slowing you down, might want to do a review of your indexes).
It's the way I do transfers from one sever to the other and has worked fine for a lot of years.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.