Vanilla 1 is no longer supported or maintained. If you need a copy, you can get it here.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
Running two forum by one vanilla package
Hi, Can any one tell me how can i run two(2) forum by same (one 1) vanilla package.
Can it be done?
Please help !
0
This discussion has been closed.
Comments
First—as always—make a backup of all files and the database.
- Rename all your existing database LUM_ tables to start something like LUM2_ (yes, including the user table)
- Add $Configuration['DATABASE_TABLE_PREFIX'] = 'LUM2_'; to your original forum’s conf/settings.php file. (Note that by default Vanilla expects the user table to always be LUM_User, so nobody will be able to log in at this point.)
- Upload a second copy of Vanilla in its own folder on your server.
- Run through the install procedure for the second Vanilla.
- Delete (drop) the LUM_User table (the fresh one just installed), and rename your LUM2_User table back to LUM_User. (Members can now log in to either old or new forum.)
- Double check your role tables (LUM_Role and LUM2_Role) to make sure they match, IDs and all. (could cause some confusing wierdness if they don’t.)
If you want to have separate users for each forum, stop after you complete step 4 and instead add $DatabaseTables['User'] = 'LUM2_User'; to your old forum’s conf/database.php file to tell Vanilla to use that user table instead of the freshly installed one. The new Vanilla will still point to the fresh users table.Last (and optional) thing to do is check out the settings.php file again, and you can point some of the paths to the other vanilla install and delete the files belonging to that Vanilla install. I wouldn't recommend doing this for the extensions path, as some extensions expect to always be inside the extensions folder of the current install (for stylesheets, images and scripts that the extension may link to.)
All tables are looked up with the $Configuration['DATABASE_TABLE_PREFIX'] (wich is set to "LUM_" by default) at the start of the table name, except for the user table. That table is looked up in whole with the value of$DatabaseTables['User'] (which is set to "LUM_User" by default.)
LUM_User is a little special on purpose, so that two installs of Vanilla can easily share the user table.
So if you wanted to move one vanilla install to make room for another that doesn't share the user table, you would have to change both the prefix to "LUM2_" and change the $DatabaseTables['User'] to "LUM2_User".
Clear as mud?
Edit: It could also be the CategoryRoles extension, which doesn't seem to use the table prefixes set, and just uses "lum_role" no matter what.
// Starts after 94
$DBPass = ForceIncomingString('DBPass', ''); $DBPrefix = ForceIncomingString('DBPrefix', 'LUM_'); $Username = ForceIncomingString('Username', '');
// Line 225
$TableToCompare = str_replace($DBPrefix, '', $TableToCompare);
// Starts new line 253
// If the prefix has been changed, change the prefixes if ($DBPrefix != $Configuration['DATABASE_TABLE_PREFIX']) { $CurrentQuery = str_replace($Configuration['DATABASE_TABLE_PREFIX'], $DBPrefix, $CurrentQuery); }
// Starts new line 282
if ($DBPrefix != $Configuration['DATABASE_TABLE_PREFIX']) { $DBManager->DefineSetting("DATABASE_TABLE_PREFIX", $DBPrefix, 1); }
// Starts new line 495
<li> <label for=\"DBPrefix\">Database Prefix</label> <input type=\"text\" id=\"DBPrefix\" name=\"DBPrefix\" value=\"".FormatStringForDisplay($DBPrefix, 1)."\" /> </li>
File: library/Framework/Framework.Functions.php
function GetTableName($Key, &$TableCollection, $Prefix) { if ($Key == "User") { if($Key != 'LUM_' && substr($TableCollection[$Key], 0, 4) == 'LUM_') { return $Prefix.substr($TableCollection[$Key], 4); } else { return $TableCollection[$Key]; } } else { return $Prefix.$TableCollection[$Key]; } }