Merging Wordpress databases - possible?

Discussion in 'WordPress' started by BP77, Aug 30, 2008.

  1. #1
    Is this possible?

    I have two websites both running off Wordpress. I'm wanting to merge the two on a new website which will have a clean install.

    Is this easy enough to do? :confused:
     
    BP77, Aug 30, 2008 IP
  2. BP77

    BP77 Peon

    Messages:
    439
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Anybody? :)
     
    BP77, Aug 31, 2008 IP
  3. mizaks

    mizaks Well-Known Member

    Messages:
    2,066
    Likes Received:
    126
    Best Answers:
    0
    Trophy Points:
    135
    #3
    First, pick one database to be the one that the other will be appended too. Add categories to the terms table if needed.

    With the other database you'll have to tinker with the posts and comments tables. The post_id and the comment_id are auto incremented so you would have to alter them to start after the last ids of the main database that you chose in step one. You would also have to change the post_id in the comments table, so comments would line up with the correct posts. Depending on the amount of posts and comments, it shouldn't take too long...
     
    mizaks, Sep 1, 2008 IP
  4. DomainCo.US

    DomainCo.US Well-Known Member

    Messages:
    2,124
    Likes Received:
    18
    Best Answers:
    0
    Trophy Points:
    100
    #4
    easy if you have db experience, if not i suggest hire someone to do it for you...
     
    DomainCo.US, Sep 1, 2008 IP
  5. BP77

    BP77 Peon

    Messages:
    439
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Posts = In total a few hundred.

    Comments = Zero as we had them switched off on both sites.

    Does that make things easier then?
     
    BP77, Sep 1, 2008 IP
  6. mizaks

    mizaks Well-Known Member

    Messages:
    2,066
    Likes Received:
    126
    Best Answers:
    0
    Trophy Points:
    135
    #6
    Sure. Now all you have to do is edit the post_id in the posts table and add any necessary categories in the terms table.
     
    mizaks, Sep 2, 2008 IP
  7. BP77

    BP77 Peon

    Messages:
    439
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #7
    Right, ok. I think. lol.

    Keep an eye on this thread in a few days if anybody is able to do this for a few $!
     
    BP77, Sep 2, 2008 IP
  8. superjacent

    superjacent Peon

    Messages:
    98
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #8
    Also keep in mind the internal links you may have in posts, that is, a link in one post, linking to another post in the same database.

    With requisite db skills the job is not that difficult.
     
    superjacent, Sep 2, 2008 IP
  9. BP77

    BP77 Peon

    Messages:
    439
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #9
    How would I get around internal links then?
     
    BP77, Sep 4, 2008 IP
  10. superjacent

    superjacent Peon

    Messages:
    98
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #10
    You need to use the replace command. I found this link through a very quick search, no doubt there are a heap of others, but at least it should point you in the right direction.

    http://www.zimmertech.com/tutorials/php/60/mysql-search-replace-phpmyadmin.php

    What you need to search and replace are the url's that are values to href and img tags:
    <a href="your internal post link"   
    Code (markup):
    and
    <img src="your internal post link"
    Code (markup):
    tags in your posts.

    If you start playing with this type of stuff, do yourself a favour and backup first.
     
    superjacent, Sep 5, 2008 IP
  11. BP77

    BP77 Peon

    Messages:
    439
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #11
    There's a few hundred posts in total between the two DBs...how much should I expect to pay for somebody to take care of all this? I can't risk losing any of the posts already made...
     
    BP77, Sep 5, 2008 IP
  12. BP77

    BP77 Peon

    Messages:
    439
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #12
    Anybody able to add to this? Will be looking for the work to be done in the next few days...
     
    BP77, Sep 11, 2008 IP
  13. BP77

    BP77 Peon

    Messages:
    439
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #13
    Anybody able to help with this? I'm happy to pay for a guide on how exactly this is done, or hire somebody to take care of it for me...
     
    BP77, Sep 14, 2008 IP