Merging 2 Sql databases

mulletgut

Senior member
Sep 3, 2002
254
0
0
Hi folks,
Without the long story, I have two very small databases backed up, which were created for the same installation of chipmunk guest book, they have different names but otherwise should be the same structure wise. (not having a clue about MySql I am only guessing that they are the same)

The thing is, I want to include the guest book entries of both databases so that they all appear in the one guest book in date order etc.

I have Direct Admin to control my account. How would I go about successfully merging the two?
I have searched and read a lot of info but nothing with a step by step on what to do which is really what I need. Am I clutching at straws?


Thanks for your time.
P.S. I hope this is in the right forum.
 

Thyme

Platinum Member
Nov 30, 2000
2,330
0
0
This really depends how they were backed up. I'll assume they were backed up as SQL inserts.

If they're small and you just have that one table to merge, open it up and find a bunch of "insert into guestbook" (or whatnot) rows and copy them into the other file just restore that file. This may fail if you have primary or foreign key constraints that are in conflict, but you can give it a shot.
 

Jaxidian

Platinum Member
Oct 22, 2001
2,230
0
71
twitter.com
Apex SQLDiff is a very powerful application that I use to merge multiple SQL Server databases. I don't know if it works with MySQL or not but it's worth a shot. You get a fully-functional 30-day trial for free if you want. I LOVE it!

-Jax
 

mulletgut

Senior member
Sep 3, 2002
254
0
0
Okay seing as they were utilised by the very same guestbook, it looks as though they are they are the same apart from the info after the INSERT INTO, which are the actual entries in the guestbook.
So if I copy/paste this section so it contains all the entries from both, (hopefully giving me what I'm after) how do I then save the file in a manner which will allow me to restore it as the database with my hosting account?
The backups I have downloaded are archives with a .gz extension, and I had to extract the .sql files to edit them. I'll google that answer, but that is where I'm at. I might try the free trial as suggested by Jaxidian if I have no luck.
Mind your heads folks..............database noob is out of control and running with scissors.

Thanks for your time folks.


***EDIT*** .gz = gunzip - Got it.