Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact us. |
|
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed. |
|
Thread Tools |
01-06-2021, 02:49 PM | #1 |
I have a plan
Industry Role:
Join Date: Aug 2004
Location: Seattle - Miami - St Kitts
Posts: 5,452
|
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?
__________________
CryptoFeeds |
01-06-2021, 03:04 PM | #2 |
Industry Role:
Join Date: Aug 2006
Location: Little Vienna
Posts: 32,234
|
Funny, i think i did same for same reason, but i don't remember what exactly i was doing it then.
|
01-06-2021, 03:08 PM | #3 | |
Registered User
Industry Role:
Join Date: Dec 2020
Location: NYC (Harlem)
Posts: 38
|
Quote:
__________________
For the past 12+ years I've focused on building & running gay affiliate sites. |
|
01-06-2021, 03:19 PM | #4 |
I have a plan
Industry Role:
Join Date: Aug 2004
Location: Seattle - Miami - St Kitts
Posts: 5,452
|
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.
__________________
CryptoFeeds |
01-06-2021, 04:36 PM | #5 | |
So Fucking Banned
Industry Role:
Join Date: Aug 2019
Posts: 1,436
|
Quote:
j/k yer feckin worm |
|
01-06-2021, 04:48 PM | #6 |
I have a plan
Industry Role:
Join Date: Aug 2004
Location: Seattle - Miami - St Kitts
Posts: 5,452
|
Judging by the questions you continually ask on this forum, it's doubtful that you know anything useful.
__________________
CryptoFeeds |
01-06-2021, 04:55 PM | #7 |
So Fucking Banned
Industry Role:
Join Date: Aug 2019
Posts: 1,436
|
|
01-06-2021, 05:21 PM | #8 |
Confirmed User
Industry Role:
Join Date: Oct 2003
Location: L.A.
Posts: 5,740
|
Completely doable. You just need to import the data according to the new structure.
__________________
Blog Posts - Contextual Links - Hardlinks on 600+ Blog Network
* Handwritten * 180 C Class IPs * Permanent! * Many Niches! * Bulk Discounts! GFYPosts /at/ J2Media.net |
01-06-2021, 05:24 PM | #9 |
I'll make you famous
Industry Role:
Join Date: Oct 2002
Posts: 13,949
|
Merged databases many times.
Some were easy, some a bitch. Have fun. . |
01-06-2021, 11:51 PM | #10 |
Confirmed User
Industry Role:
Join Date: Jan 2020
Posts: 221
|
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; |
01-07-2021, 07:30 AM | #11 | |
I have a plan
Industry Role:
Join Date: Aug 2004
Location: Seattle - Miami - St Kitts
Posts: 5,452
|
Quote:
__________________
CryptoFeeds |
|
01-07-2021, 07:45 AM | #12 |
Confirmed User
Industry Role:
Join Date: Aug 2006
Location: Poland
Posts: 9,217
|
We do this all the time. That way won't work well for you because the table would have to have fields in the same order.
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`
__________________
Mechanical Bunny Media Mechbunny Tube Script | Mechbunny Webcam Aggregator Script | Custom Web Development |
01-07-2021, 07:55 AM | #13 |
Bollocks
Industry Role:
Join Date: Jun 2007
Location: Bollocks
Posts: 2,792
|
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.
__________________
Interserver unmanaged AMD Ryzen servers from $73.00 |
01-07-2021, 01:44 PM | #14 |
I have a plan
Industry Role:
Join Date: Aug 2004
Location: Seattle - Miami - St Kitts
Posts: 5,452
|
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.
__________________
CryptoFeeds |