Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Syncing old server to new - MySQL

Posted on 2014-02-14
9
Medium Priority
?
215 Views
Last Modified: 2014-02-25
We have a web server that is crashing/unstable - and a new server that has been bare-metal installed from a backup from broken server about a week old.  There is, however, new data (both mysql and actual PHP files.)

I'm going to break this up into two questions - this is just for the MySQL.

How would you recommend I go about syncing up just the newer files?  Is there a way for me to just transfer over the relevant MySQL files and doing so will it automatically "update" due to the replacement?  My normal way of doing it would be to go site by site and through phpMyAdmin export the tables/databases...then import them into the databases on the new server...but that will kinda suck.  Is there a quicker/more efficient way of doing it?

Thanks in advance!
0
Comment
Question by:erzoolander
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
  • 2
  • +1
9 Comments
 
LVL 40

Expert Comment

by:noci
ID: 39861373
You should be able to make an export from the old database & import that into the new one.
As long as the tables are NOT the same in the same 'database' you can import data.
0
 
LVL 21

Expert Comment

by:Mazdajai
ID: 39862113
Have you try tar up the entire directory (mysql/php) from source and extract it to the target?
0
 
LVL 40

Expert Comment

by:noci
ID: 39862563
@MAzdajai, that can only be done if the source was halted before the copy is taken
AND more important if the replica doesn't need to be merged into an existing database on the target.

Otherwise you will delete all existing data on the destination.
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
LVL 13

Expert Comment

by:Sandy
ID: 39864443
Create Master/ Slave config and perform the replication once done convert slave in master.

TY/SA
0
 
LVL 21

Expert Comment

by:Mazdajai
ID: 39865163
It sound like the new server is not yet in production and the goal is to restore the php and mysqld in the quickest manner. (I could be wrong of course)

IMHO it is easier restore them on the system level versus on the application level... I am not aware you can globally restore all web sites via phpmyadmin.
0
 
LVL 2

Author Comment

by:erzoolander
ID: 39865625
Nope - the PhPMyAdmin level I was pretty much thinking going on a site by site basis...and you're correct...it's not yet in production.  It's still set as a staging server as I'm migrating all of the data over.

I'd LIKE to be as quick as possible about it - so I'm wondering if there's a way to go on to the old server and say "Export everything" from shell/root...and then go to the new server and essentially "restore" with a similar command to re-import everything back in.

My only concern about that - however - is that the system is administered by PLESK...and I'd be afraid that doing a global export might screw something up.  So I'd rather just say Dump databases A, B, C, D and then on the new server import A, B, C, D - leaving everything else in tact.

Is that a decent approach you think - and is there way for me to from root/shell export just a given number of databases/then reimport them?

Thanks!
0
 
LVL 21

Expert Comment

by:Mazdajai
ID: 39872343
>>if there's a way to go on to the old server and say "Export everything" from shell/root...and then go to the new server and essentially "restore"
Have you consider my above suggestion? This is a cold dump therefore you would need to stop mysql.

It is not possible to export certain database on the system level. You can only achieve  that with the help of mysqldump binary -

mysqldump -u root -p[root_password] [database_name] > dumpfilename.sql

Open in new window

0
 
LVL 40

Accepted Solution

by:
noci earned 2000 total points
ID: 39875348
and in the previously mentioned mysqldump --all-databases  can dump ALL relevant databases.
(i.e. not the dictionary databases).
No database needs to be mentioned then:


mysqldump -u root -p[root_password] --all-databases > dumpfilename.sql

Open in new window

or
mysqldump -u root -p[root_password] -A > dumpfilename.sql

Open in new window

0
 
LVL 2

Author Closing Comment

by:erzoolander
ID: 39887744
Gracias!
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Network Interface Card (NIC) bonding, also known as link aggregation, NIC teaming and trunking, is an important concept to understand and implement in any environment where high availability is of concern. Using this feature, a server administrator …
I. Introduction There's an interesting discussion going on now in an Experts Exchange Group — Attachments with no extension (http://www.experts-exchange.com/discussions/210281/Attachments-with-no-extension.html). This reminded me of questions tha…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial
Suggested Courses

610 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question