If you have a multilingual forum or two different phpBB forums and you need to merge users, groups, bans for those phpBB boards, follow this tutorial:
– copy, rename, edit MySQL tables
– basic PHP knowledge
– a good text editor
– access to CPanel, databases and FTP
I assume that you already have two phpBB boards, with all MySQL tables needed and with two different prefixes in one database, each set of tables acting as a database for your phpBB board.
First step is to make a backup to your boards, MySQL database backup and files backup.
Next you will need to rename some MySQL tables and to make some changes in your PHP files.
Assuming that your table prefixes are phpbb_ and phpbbsb_, you will have to rename some MySQL tables:
Rename the following tables as bellow:
phpbb_banlist to banlist phpbb_disallow to disallow phpbb_groups to groups phpbb_privmsgs to privmsgs phpbb_privmsgs_folder to privmsgs_folder phpbb_privmsgs_rules to privmsgs_rules phpbb_privmsgs_to to privmsgs_to phpbb_ranks to ranks phpbb_sessions to sessions phpbb_sessions_keys to sessions_keys phpbb_smilies to smilies phpbb_users to users phpbb_user_group to user_group phpbb_words to words
Next step is to edit the PHP file called includes/constants.php on both phpBB boards (you can use your standard File Manager from CPANEL) and to remove the table_prefix from some constants.
Replace this lines:
define('BANLIST_TABLE', '$table_prefix . banlist'); define('DISALLOW_TABLE', '$table_prefix . disallow'); define('GROUPS_TABLE', '$table_prefix . groups'); define('PRIVMSGS_TABLE', '$table_prefix . privmsgs'); define('PRIVMSGS_FOLDER_TABLE', '$table_prefix . privmsgs_folder'); define('PRIVMSGS_RULES_TABLE', '$table_prefix . privmsgs_rules'); define('PRIVMSGS_TO_TABLE', '$table_prefix . privmsgs_to'); define('RANKS_TABLE', '$table_prefix . ranks'); define('SESSIONS_TABLE', '$table_prefix . sessions'); define('SESSIONS_KEYS_TABLE', '$table_prefix . sessions_keys'); define('SMILIES_TABLE', '$table_prefix . smilies'); define('USER_GROUP_TABLE', '$table_prefix . user_group'); define('USERS_TABLE', '$table_prefix . users'); define('WORDS_TABLE', '$table_prefix . words');
With this corresponding lines, on both boards:
define('BANLIST_TABLE', 'banlist'); define('DISALLOW_TABLE', 'disallow'); define('GROUPS_TABLE', 'groups'); define('PRIVMSGS_TABLE', 'privmsgs'); define('PRIVMSGS_FOLDER_TABLE', 'privmsgs_folder'); define('PRIVMSGS_RULES_TABLE', 'privmsgs_rules'); define('PRIVMSGS_TO_TABLE', 'privmsgs_to'); define('RANKS_TABLE', 'ranks'); define('SESSIONS_TABLE', 'sessions'); define('SESSIONS_KEYS_TABLE', 'sessions_keys'); define('SMILIES_TABLE', 'smilies'); define('USER_GROUP_TABLE', 'user_group'); define('USERS_TABLE', 'users'); define('WORDS_TABLE', 'words');
In the next step we will make some changes in Cookies Settings:
– open your main board and login as Admin
– open the second board
– on the main board go to Admin Control Panel -> General -> Server Configuration -> Cookie Settings and copy those settings to your second board.
Cookie Domain should be your main domain (ex: domainname.com, without www or other subdomain)
Here comes the tricky part, which is not documented on other tutorials. As you know, phpBB stores permissions cache in the user table in a field called user_perimissions. This is a huge problem, the permissions cache will generate and store permissions sets for each user and for one single board (at first user login or after purging the cache), permissions sets that will not be valid for the second board. Because of this issue your users will be unable to view all the forums and topics when switching between phpBB boards.
To solve this problem, using PhpMyAdmin, open the user table and add a new field after the user_permissions field and name it user_permissions_sb.
When creating the user_permissions_sb field choose MEDIUMTEXT as type and make sure that the NULL option is checked. You will also need to edit the user_permissions field, select the NULL option and save.
Now open the files bellow, only on your second board, and replace all user_permissions occurrences with user_permissions_sb:
includes/auth.php includes/functions_privmgs.php includes/functions_user.php includes/session.php includes/acp/acp_permissions.php includes/acp/auth.php includes/ucp/ucp_remind.php
The last step is to go to your Administrator Control Panel and to Purge the Cache on each board.
Additional steps maybe needed depending on each board configuration. For example, if you have useful users on both boards, you may also need to import them in to the main user table.
You can also drop these tables from your database (these tables will no longer be used by the second board):
phpbbsb_banlist phpbbsb_disallow phpbbsb_groups phpbbsb_privmsgs phpbbsb_privmsgs_folder phpbbsb_privmsgs_rules phpbbsb_privmsgs_to phpbbsb_ranks phpbbsb_sessions phpbbsb_sessions_keys phpbbsb_smilies phpbbsb_users phpbbsb_user_group phpbbsb_words