Topic: Possible to combine 2 databases?

Say I have two message boards, very similar, and want to close one down but want to move all the people/forums/topics etc to my other board.

Can I somehow incorporate the one database into the second database? Is this possible?

Re: Possible to combine 2 databases?

Export it. Then import it into the other one. PhpMyAdmin can do this easily. But you should be sure that there are no double entries (like two users with the same name or something like that)! Double entries could lead to problems.

3

Re: Possible to combine 2 databases?

that's hard to do.perhaps given up one.

Re: Possible to combine 2 databases?

The way this is possible is:

  • Have the both forums within the same table, but different prefix's

  • Create a script (which would be too hard) that will do for each row, insert it into the new db. You would have to do this for Users

It wouldnt be possible for Forums/Topics/Posts as the foreign keys will change and wont work.

Sorry. Unactive due to personal life.

Re: Possible to combine 2 databases?

Lots of good ideas, thanks!  Would it be possible to just go into configuration and change where  the new, empty board points, change the config so the second board uses the same database?  Would that cover it?

6 (edited by gorsan 2009-02-13 00:16)

Re: Possible to combine 2 databases?

i am already doing this
it is easy
the forumid and topicid and postid
should not intersect you have to make iterations in 1 of the boards
how  to make iterations ? example is below i am not sure the table names are correct you have to confirm it.
UPDATE forum
SET forumid=forumid+1289;

UPDATE thread
SET threadid=threadid+450000;
UPDATE thread
SET forumid=forumid+1289;

  UPDATE post
SET postid=postid+2400000;
UPDATE post
SET threadid=threadid+450000;

you will have to create new forums matching  forum id on your 2nd forum which you are closeing

mysqldump -u dbuser -p[pwd] --no-create-db --no-create-info database2nd > database_backup.sql
mysql -u dbuser -p[pwd]  database1st < database_backup.sql