Hi all,
I know i'm a newbie and everything, but with Oldiesmann's permission, and with great pleasure, I present an updated version of a script that will merge two SMF forum databases into one.
Original version for SMF 1.0.x by Oldiesmann at SimpleMachines.org
Many thanks for throwing it together and giving us something to work with.
Modified version for SMF 1.1RC3 by Resourcez at resourcez.biz (way back in 2006)
Modified version for SMF 2.0.6 by bfeist (fall, 2013). Let's start this new version at 2.0.
Description:This script will merge two SMF forums. It will takes the boards, topics, members, messages, etc from a SECONDARY forum and merge it into a PRIMARY forum. The PRIMARY forum has to be larger than the secondary (because topics will be numbered based on the max topic number in the PRIMARY forum).
You need to be comfortable with PHP, and wrapping your head around databases etc to use this script. It works, but it will take some trial and error to get everything right.
Known Problems:This script merges topics by adding SECONDARY topics after the largest PRIMARY topicID. This results in all secondary messages appearing to be newer than any in the PRIMARY forum (in spite of the topic date). This is due to the way SMF sorts by default (to avoid DB performance hits) based on topicID rather than date. I believe this can be remedied by using a mod that allows a different sort method, but you take the performance hit.
It would be great if someone felt like writing a cool script that literally spliced the topicIDs of both PRIMARY and SECONDARY forums together based on topic date. This would result in a true merge of forums.
Instructions:1. Download SMF and install it in two different places on your site, both installations within the same database (just use a different database prefix like smf2_ for the SECONDARY, smaller one). It's important that the SECONDARY board is smaller than the primary board.
2. Edit this file in a text editor and change line 25 below to match the database prefix of the PRIMARY smf board, your main, largest board (define('PRIMARY_DB_PREFIX', 'smf_') - change smf_ to whatever you used...).
4. Save this modified file, put it in the directory for the SECONDARY, smaller smf installation and run it (just like you would run install.php or the converter).
5. Follow the instructions, clicking the "Continue" link as needed (there are 10 steps to avoid it timing out).
6. Copy all files in your SECONDARY attachments/to_move_to_primary directory to the primary attachments directory.
7. Once you're done, if everything worked, login to your PRIMARY SMF board, go to Admin -> Forum Maintenance and click on "Recount all totals and statistics" - this will update everything for you.
8. Check for any members in the new (merged) PRIMARY SMF installation that start with "todelete_". These members need to be merged with the members of the same name using a tool like SMF Admin Toolbox (
https://github.com/Spuds/SMF-Admin-Toolbox)
Revision history:
2.0 Nov 2/2013
Initial updated script for use with 2.0.6
2.0.1 Nov 2/2013
Added an initial step to confirm initiation of the script.
2.0.2 June 17/2014
Fixed an error that skipped step 8.