![]() |
Anyone ever merge 2 different mySQL databases?
I'm trying to cobble together a new TGPX site. I've got a mySQL database with 12 years of daily updates in text form that I would like to merge into a new database.
Is this doable? Has anyone ever done it or know someone who has? I may have to get a copy of mySQL for dummies otherwise. Now just because I mentioned TGPX, I don't want everybody here to start building TGP sites. Promise? :1orglaugh:1orglaugh:1orglaugh |
Funny, i think i did same for same reason, but i don't remember what exactly i was doing it then.
|
Quote:
|
I'm learning just enough to fuck up. But the installation is new so I backed up the new empty database for good measure. So I will try to figure out the data structure and match what I have to what the TGPX database has.
|
Quote:
j/k yer feckin worm |
Judging by the questions you continually ask on this forum, it's doubtful that you know anything useful.
|
Quote:
I might act stoopid (for fun) but I have an IQ of some high number. |
Completely doable. You just need to import the data according to the new structure.
|
Merged databases many times.
Some were easy, some a bitch. Have fun. . |
Can you dump the old table info into a csv file, then upload the csv to the new database table?
Like so? SELECT customer_id, firstname, surname INTO OUTFILE '/customers.csv' FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"' LINES TERMINATED BY '\n' FROM customers; LOAD DATA INFILE '/customers.csv' INTO TABLE customers FIELDS TERMINATED BY ',' ENCLOSED BY '"' LINES TERMINATED BY '\n' IGNORE 1 ROWS; |
Quote:
|
Quote:
You should make one user that has access to both databases and then do something like INSERT INTO `newDb`.`newTable` (col1,col2,col3,col4,col5) SELECT correspondingcol1,correspondingcol2,correspondingc ol3,correspondingcol4,correspondingcol5 FROM `oldDb`.`oldTable` |
I obviously don't know how TGPX's tables are structured but if you have any relational tables in there then I wouldn't attempt this until you understand what they are and what tables they join to, otherwise just copying rows from one table to another will muck up the indices. Make sure you back everything up because you are bound to screw this up several times over and SQL doesn't have an undo button.
|
Thanks for the advice K0nr4d and redwhiteandblue.
MojoHost is dumping the databases for me to work on offline and suggested some links for programs to use. Since the TGPX site is brand new, I can always re-install everything if I wreck the merge. It will be worth it though if it works. |
All times are GMT -7. The time now is 02:19 PM. |
Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc