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

How to combine mysql database.

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

  1. Ayomav

    Ayomav Regular Member

    Joined:
    Nov 23, 2011
    Messages:
    250
    Likes Received:
    19
    Hello guys,

    I have a database A and database B, they are database for 2 wordpress blogs, I want to import all the posts in database B into A, so if I have 100 posts in blog A and 100 posts in blog B, I want blog A to have 200 posts.

    Anyone knows how to do this in mysql database or in myphpadmin ?

    Thanks
     
  2. infTee

    infTee Junior Member

    Joined:
    Mar 2, 2010
    Messages:
    101
    Likes Received:
    97
    Location:
    Ireland
    Since they are WP blogs just go into Tools->Export on the dashboard of site B. Export all posts, then go to Tools->Import on site A.
     
    • Thanks Thanks x 1
  3. paincake

    paincake Power Member

    Joined:
    Aug 18, 2010
    Messages:
    716
    Likes Received:
    3,099
    Home Page:
    Use WP export function, as infTee suggested.
    If you use mysql, your post IDs will clash and you wont be able to import posts from the 2nd blog.

    Edit: i'm not so sure about wp's export function either, because the xml file that wp exports contains post/comment ids, but perhaps wordpress recognizes clashes and assigns new ids. Just try it and let us know if it works.
     
    Last edited: Dec 17, 2011
  4. cheapconsultant

    cheapconsultant Newbie

    Joined:
    Jul 20, 2012
    Messages:
    1
    Likes Received:
    0
    You will have to use PhpAdmin in order to do that...and both database MUST have the same tables and fields... its quite a big job to do.. but you'll do it only once..

    procedure to copy data from one DB to another

    part 1) FROM SOURCE DB TO COPY

    1) go in your source DB in PhpMyAdmin
    2) List all the tables from the DB.
    3) Rename each table adding 1 at the end
    4) Export the DB to a file in the export tab

    part 2) FROM DESTINATION DB.

    1) go in php myadmin to list all the table from the destination tables
    2) to in the import tab and import the file create in part 1
    3) you will now see all your tables in double like this :
    users
    users_1 (renamed table from part 1)

    4) once this is done.. just run an sql query for each table using the following command on the run sql query tab.

    INSERT INTO users SELECT * from users_1

    5) repeat that sql query for each table by replacing the tables names (users, users_1



    all your data will be inserted in the destination table..

    regards
     
  5. kindit77

    kindit77 Regular Member

    Joined:
    Feb 5, 2008
    Messages:
    249
    Likes Received:
    23
    I have no idea on how to do this, but i heard people in the know are making a killing in adsense through database driven website, such as company contact info site or service directory site. How can i do this too using wordpress. Regards