Tetra WebBBS Documentation
Standalone tool designed to merge two forums into one new forum.
Special thanks to Benjamin and Judy from AnimalAdvocates.com who sponsored this tool in 2009.
Motivation
- merge two previously independent forums into one new forum
- forums to be merged may have overlapping message numbers
- the merging procedure sorts merged messages on the time of posting and renumbers the messages accordingly.
Be aware that renumbering messages means old links pointing to individual messages will no longer work. - That's the price for a merge! - the tool is NOT designed to merge archives which have been derived from the same live forum though it can be used to merge archives derived from different live forums into a new forum/archive.
Requirements
You must already have a working installation of version 6.00 (or higher) forum scripts.
Forums to be merged and the new merged board must use the same $data_basedir and the same $html_basedir (if defined).
Configuration
section (1) - required configuration:
- $data_basedir
Set this variables to the same value used in the corresponding *_config.pl files of your forum. - $html_basedir
Optional variable, defaults to '/webbbs'.
If this variable IS defined in the forums to be merged, then you must define it in this tool. Otherwise leave undefined. - $data_subdir_input_1 and $data_subdir_input_2
Set these variables the same as $data_subdir in the 1st and 2nd of the boards to be merged - $live_subdir_input_1 and $live_subdir_input_2
These variables are optional. If $live_subdir is defined in public entry script of either the 1st or 2nd board to be merged, then set the appropriate variable of this tool to the same value. - $data_subdir_output
This variable defines the $data_subdir variable for the new merged forum.
After the merge is completed you must use the same value defined here for setting the $data_subdir variable in the new (merged) forum's entry scripts.
section (2) - optional configuration:
- $max_merge
If your server is limited in CPU-usage or script-runtime or you're merging large forums, you may define the number of MESSAGES to be merged at one call of the script.
If your server is not so limited, set $max_merge to '0' and the tool will attempt to merge all posts in one chunk. - use lib directive
Define path to core scripts only when the 'lib' folder is not on the same level as the merge tool.
This works pretty much the same as in any other entry script.
NOTE:
If you plan on running the tool from commandline you must define the $ENV{'DOCUMENT_ROOT'} variable at the top of the script, just below the path to Perl. If you don't know about it, ask at support board.
Upload the script
Upload the script to your server (ASCII mode), preferably alongside your admin-scripts!
Chmod the script 755.
Merge forums
The following example describes the merging procedure AFTER the correct configuration is completed, as described above!
For this example the assumption is that $data_subdir_input_1 and $data_subdir_input_2 are set to /forum_1 and /forum_2 and that $data_subdir_output is set to /forum_new. - It's the interpretation of merging /forum_1 and /forum_2 into a new /forum_new!
Here is a step-by-step approach. Make sure to apply the correct configs for all variables described above before starting the merge procedure!
- Cleanup the moderated bin and ALL parking folders of forums 1 and 2.
These folders will be erased during the merge procedure, including all their contents! - Ensure there isn't ANYTHING in the folders /forum_1 and /forum_2 which isn't created by the forums.
After the merge procedure is finished a housekeeping routine will erase these two folders and everything inside. - Create a backup of the entire $data_basedir folder and all it's content.
Merging is a definite process and CAN'T be reverted other than by restoring a backup! - Run the tool for the first time by pointing your browser to it's URL or by starting from commandline.
The tool will build a temporary mergelist database for subsequent runs. - Follow simple instructions provided in browser window until you get the message that all posts have been merged into the new forum.
- Edit existing public and admin entry scripts for Forum 1 to become the new entry scripts for the merged forum:
- Open public and admin entry scripts for Forum 1 in your texteditor.
- Change the $data_subdir variable to point to /forum_new.
- Ensure the $live_subdir variable is undefined.
- Upload these public and admin entry scripts to your server
- Go to the admin portal page using the previously uploaded admin entry script and rebuild the message index database
- Optional for users of TetraBB PRO extension only:
If the PRO search is enabled you'll need to rebuild the searchindex FROM SCRATCH! - Point your browser to public and admin scripts uploaded in #6. The message index is supposed to display the new, merged forum.
- Delete public and admin entry script of your (old) Forum 2 to avoid confusion and misuse!
- Done
Security: After you merged the forums and everything is finished, consider removing the merge2boards tool from your server. That's certainly the best protection against abuse! What's not available on a server can't be abused ;)

![[+]](/i/toc_collapsed.gif)
![[-]](/i/toc_expanded.gif)
WebScripts










