LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 04-07-2016, 10:23 PM   #1
yoachan
Member
 
Registered: Nov 2009
Posts: 109

Rep: Reputation: 16
Post 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:
  1. Combines those two old servers into one new server.
  2. Upgrade our beloved MySQL 5.0.77 to Maria-db 10.
  3. 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...

Regards,

Yoachan

Last edited by yoachan; 04-07-2016 at 10:25 PM.
 
Old 04-10-2016, 12:33 PM   #2
tronayne
Senior Member
 
Registered: Oct 2003
Location: Northeastern Michigan, where Carhartt is a Designer Label
Distribution: Slackware 32- & 64-bit Stable
Posts: 3,541

Rep: Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065
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.

Hope this helps some.
 
Old 04-10-2016, 11:24 PM   #3
yoachan
Member
 
Registered: Nov 2009
Posts: 109

Original Poster
Rep: Reputation: 16
@tronayne:

Thank you for your help. we'll be doing as you suggested.
Turning off indexes seems like a good idea.
will give it a shot.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Tuning mysql server (InnoDB engine) robertjinx Linux - Server 14 01-18-2016 03:12 AM
[SOLVED] Upgrading Mysql to 5.6.12 from 5.5.25 on centos 5.8 (64 bit) server Rohant Linux - Server 2 09-30-2013 09:16 PM
Upgrading/migrating server MartenH Linux - Server 1 12-22-2009 05:46 PM
Time on Server keeps changing whether I'm using NTP or not. custangro Linux - Server 15 05-12-2009 03:57 PM
LXer: Golden's Rules: Migrating from SQL Server to MySQL LXer Syndicated Linux News 0 05-08-2006 06:22 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 11:31 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration