1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

How to merge 2 sql file.

Discussion in 'Black Hat SEO' started by Ayomav, Dec 17, 2011.

  1. Ayomav

    Ayomav Regular Member

    Joined:
    Nov 23, 2011
    Messages:
    250
    Likes Received:
    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
     
  2. MrBlue

    MrBlue Senior Member

    Joined:
    Dec 18, 2009
    Messages:
    950
    Likes Received:
    662
    Occupation:
    Web/Bot Developer
    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
     
    • Thanks Thanks x 1
  3. Ayomav

    Ayomav Regular Member

    Joined:
    Nov 23, 2011
    Messages:
    250
    Likes Received:
    19
    I got it, thanks, but how do you change ids automatically, if there is 1k+ plus ids.Any idea ?

    Thanks
     
  4. Corrupt

    Corrupt BANNED BANNED

    Joined:
    Sep 15, 2011
    Messages:
    805
    Likes Received:
    412
    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.
     
  5. andreybl

    andreybl Registered Member

    You could also add the both tables to MySQL, then load them via script and add them again to new table without the id.