I don't know the structure of this database. But anyway, these operations are often tricky and you risk to corrupt your data. You should thourougly test before going into production system.
What you have to do:
(Assuming a user-table, and a topics-table, if there are more you need to cascade the instructions on them)
- For one of the databases, increment the topic_id by a value such as you will not have duplicates from both databases. E.G. if in DB1 your max(topic_id)=2000, you should do in DB2: topic_id = topic_id + 2000
You have to increment the topic id for any field in any table referring to it (e.g. parent_id, ...)
- In the database where you change the topic_id, also change the user_id by an adequate increment; increment all occurrences of user_id in any table !!
Export the updated database and import it into the other one.
This works in this "simple" way ONLY if there are no referential integritys working, like in a MySQL database! (On Oracle or other DBMS, you have to take care of these: deactivate, duplicate data into other tables or into the same, depending on complexity).
One way to work if you have referential integrity constraints (and you cannot create new tables) is like this:
Assume you have a referential integrity on the user_id.
You then have to duplicate the users into the same table, with incremented user_id.
Then you update the user_id in the topis table with the same increment step. After this, you can delete the old users with their IDs, as there are no more dependencies.
Then export and import into the other DB.
In these scenarios you cannot expect to have identical user_id for one single person posting to both forums! You might run into trouble here to identify the users, as you cannot have two users with the same login! You have to take care of this ... manually!
Without a deeper knowledge of the DB, I can only tell you: BE CAREFUL. VERY CAREFUL!
This is just basic ideas about how I would proceed if I had to do this job! An good analyse of the databases (structure and data) is required before action.
Good luck,
JJ Mouris