How to merge 2 sql file.

Ayomav

Regular Member
Nov 23, 2011
250
19
Hello guys,

I'm trying to merge 2 sql file, the only problem is I need to change the post ID for the 2nd file before pasting it in the 1st file.There are 1k+ tables so it's not easy to do it manually.You guys know a way to change the numbers of post ID ? I have tried using csv file but it doesn't work, I'm going try again, please comment if you know a way to do it.

Thanks
 
1- Export both SQL tables as separate CSV files. 2- Using a spreadsheet application (like MS Excel) change all ids in the 2nd file. 3- Merge both CSV files together and re-import via phpmyadmin
 
1- Export both SQL tables as separate CSV files. 2- Using a spreadsheet application (like MS Excel) change all ids in the 2nd file. 3- Merge both CSV files together and re-import via phpmyadmin

I got it, thanks, but how do you change ids automatically, if there is 1k+ plus ids.Any idea ?

Thanks
 
Try this:
Open the Second Database in Excel
1. Clear the column with the post IDS
2. Add a number XXXX which is 1 more than the last Post ID of the first SQL database, in the first cell of post IDs.
3. Add XXXX+1 in the cell below it.
4. Select both the cells. Click the little black box that comes in the lower right corner, and drag it all the way to the bottom. Excel will automatically increment the values by 1 for each cell.

Hope this helps.
 
You could also add the both tables to MySQL, then load them via script and add them again to new table without the id.
 
Back
Top
AdBlock Detected

We get it, advertisements are annoying!

Sure, ad-blocking software does a great job at blocking ads, but it also blocks useful features and essential functions on BlackHatWorld and other forums. These functions are unrelated to ads, such as internal links and images. For the best site experience please disable your AdBlocker.

I've Disabled AdBlock