Ok - I tried that, a few times. Either I'm doing something wrong or it just doesn't want to do what I want it to do.
Anyhow - This is what I want:
I have http://www.domain1.com/forum/ and http://www.domain2.com/forums/
Each forums have the prefix _phpbb, but each forum are at DIFFERENT places. Eg (if you know cPanel, you'll understand): one database is domain1_forum and the other is domain2_forum
They are both at the same host, but on different hosting accounts!
Is there a simple script to merge the two forums?
Thanks.
Shifting IDs in table categories
UPDATE test.phpbbsw_categories SET cat_id = cat_id + 2 + 9 WHERE cat_id > 0
UPDATE test.phpbbsw_categories SET cat_id = cat_id - 2 WHERE cat_id > 0
Altering dependent table: forums : cat_id (offset = 9)
UPDATE test.phpbbsw_forums SET cat_id = cat_id + 2 + 9 WHERE cat_id > 0
UPDATE test.phpbbsw_forums SET cat_id = cat_id - 2 WHERE cat_id > 0
Shifting IDs in table forums
UPDATE test.phpbbsw_forums SET forum_id = forum_id + 3 + 31 WHERE forum_id > 0
UPDATE test.phpbbsw_forums SET forum_id = forum_id - 3 WHERE forum_id > 0
Altering dependent table: posts : forum_id (offset = 31)
UPDATE test.phpbbsw_posts SET forum_id = forum_id + 3 + 31 WHERE forum_id > 0
UPDATE test.phpbbsw_posts SET forum_id = forum_id - 3 WHERE forum_id > 0
Altering dependent table: topics : forum_id (offset = 31)
UPDATE test.phpbbsw_topics SET forum_id = forum_id + 3 + 31 WHERE forum_id > 0
UPDATE test.phpbbsw_topics SET forum_id = forum_id - 3 WHERE forum_id > 0
Altering dependent table: forum_prune : forum_id (offset = 31)
UPDATE test.phpbbsw_forum_prune SET forum_id = forum_id + 0 + 31 WHERE forum_id > 0
UPDATE test.phpbbsw_forum_prune SET forum_id = forum_id - 0 WHERE forum_id > 0
Altering dependent table: auth_access : forum_id (offset = 31)
UPDATE test.phpbbsw_auth_access SET forum_id = forum_id + 2 + 31 WHERE forum_id > 0
UPDATE test.phpbbsw_auth_access SET forum_id = forum_id - 2 WHERE forum_id > 0
Shifting IDs in table forum_prune
Empty table? Skipping...
Shifting IDs in table groups
UPDATE test.phpbbsw_groups SET group_id = group_id + 31 + 66 WHERE group_id > 0
UPDATE test.phpbbsw_groups SET group_id = group_id - 31 WHERE group_id > 0
Altering dependent table: user_group : group_id (offset = 66)
UPDATE test.phpbbsw_user_group SET group_id = group_id + 31 + 66 WHERE group_id > 0
UPDATE test.phpbbsw_user_group SET group_id = group_id - 31 WHERE group_id > 0
Altering dependent table: auth_access : group_id (offset = 66)
UPDATE test.phpbbsw_auth_access SET group_id = group_id + 4 + 66 WHERE group_id > 0
UPDATE test.phpbbsw_auth_access SET group_id = group_id - 4 WHERE group_id > 0
Shifting IDs in table posts
UPDATE test.phpbbsw_posts SET post_id = post_id + 878 + 5211 WHERE post_id > 0
UPDATE test.phpbbsw_posts SET post_id = post_id - 878 WHERE post_id > 0
Altering dependent table: posts_text : post_id (offset = 5211)
UPDATE test.phpbbsw_posts_text SET post_id = post_id + 878 + 5211 WHERE post_id > 0
UPDATE test.phpbbsw_posts_text SET post_id = post_id - 878 WHERE post_id > 0
Altering dependent table: topics : topic_first_post_id (offset = 5211)
UPDATE test.phpbbsw_topics SET topic_first_post_id = topic_first_post_id + 871 + 5211 WHERE topic_first_post_id > 0
UPDATE test.phpbbsw_topics SET topic_first_post_id = topic_first_post_id - 871 WHERE topic_first_post_id > 0
Altering dependent table: topics : topic_last_post_id (offset = 5211)
UPDATE test.phpbbsw_topics SET topic_last_post_id = topic_last_post_id + 878 + 5211 WHERE topic_last_post_id > 0
UPDATE test.phpbbsw_topics SET topic_last_post_id = topic_last_post_id - 878 WHERE topic_last_post_id > 0
Shifting IDs in table privmsgs
UPDATE test.phpbbsw_privmsgs SET privmsgs_id = privmsgs_id + 173 + 553 WHERE privmsgs_id > 0
UPDATE test.phpbbsw_privmsgs SET privmsgs_id = privmsgs_id - 173 WHERE privmsgs_id > 0
Altering dependent table: privmsgs_text : privmsgs_text_id (offset = 553)
UPDATE test.phpbbsw_privmsgs_text SET privmsgs_text_id = privmsgs_text_id + 173 + 553 WHERE privmsgs_text_id > 0
UPDATE test.phpbbsw_privmsgs_text SET privmsgs_text_id = privmsgs_text_id - 173 WHERE privmsgs_text_id > 0
Altering dependent table: users : user_last_privmsg (offset = 553)
UPDATE test.phpbbsw_users SET user_last_privmsg = user_last_privmsg + 1071936691 + 553 WHERE user_last_privmsg > 0
UPDATE test.phpbbsw_users SET user_last_privmsg = user_last_privmsg - 1071936691 WHERE user_last_privmsg > 0
Shifting IDs in table topics
UPDATE test.phpbbsw_topics SET topic_id = topic_id + 143 + 695 WHERE topic_id > 0
UPDATE test.phpbbsw_topics SET topic_id = topic_id - 143 WHERE topic_id > 0
Altering dependent table: posts : topic_id (offset = 695)
UPDATE test.phpbbsw_posts SET topic_id = topic_id + 143 + 695 WHERE topic_id > 0
UPDATE test.phpbbsw_posts SET topic_id = topic_id - 143 WHERE topic_id > 0
Altering dependent table: topics_watch : topic_id (offset = 695)
UPDATE test.phpbbsw_topics_watch SET topic_id = topic_id + 141 + 695 WHERE topic_id > 0
UPDATE test.phpbbsw_topics_watch SET topic_id = topic_id - 141 WHERE topic_id > 0
Altering dependent table: vote_desc : topic_id (offset = 695)
UPDATE test.phpbbsw_vote_desc SET topic_id = topic_id + 133 + 695 WHERE topic_id > 0
UPDATE test.phpbbsw_vote_desc SET topic_id = topic_id - 133 WHERE topic_id > 0
Shifting IDs in table users
UPDATE test.phpbbsw_users SET user_id = user_id + 29 + 213 WHERE user_id > 0
UPDATE test.phpbbsw_users SET user_id = user_id - 29 WHERE user_id > 0
Altering dependent table: user_group : user_id (offset = 213)
UPDATE test.phpbbsw_user_group SET user_id = user_id + 29 + 213 WHERE user_id > 0
UPDATE test.phpbbsw_user_group SET user_id = user_id - 29 WHERE user_id > 0
Altering dependent table: groups : group_moderator (offset = 213)
UPDATE test.phpbbsw_groups SET group_moderator = group_moderator + 0 + 213 WHERE group_moderator > 0
UPDATE test.phpbbsw_groups SET group_moderator = group_moderator - 0 WHERE group_moderator > 0
Altering dependent table: posts : poster_id (offset = 213)
UPDATE test.phpbbsw_posts SET poster_id = poster_id + 28 + 213 WHERE poster_id > 0
UPDATE test.phpbbsw_posts SET poster_id = poster_id - 28 WHERE poster_id > 0
Altering dependent table: topics : topic_poster (offset = 213)
UPDATE test.phpbbsw_topics SET topic_poster = topic_poster + 21 + 213 WHERE topic_poster > 0
UPDATE test.phpbbsw_topics SET topic_poster = topic_poster - 21 WHERE topic_poster > 0
Altering dependent table: privmsgs : privmsgs_to_userid (offset = 213)
UPDATE test.phpbbsw_privmsgs SET privmsgs_to_userid = privmsgs_to_userid + 28 + 213 WHERE privmsgs_to_userid > 0
UPDATE test.phpbbsw_privmsgs SET privmsgs_to_userid = privmsgs_to_userid - 28 WHERE privmsgs_to_userid > 0
Altering dependent table: privmsgs : privmsgs_from_userid (offset = 213)
UPDATE test.phpbbsw_privmsgs SET privmsgs_from_userid = privmsgs_from_userid + 28 + 213 WHERE privmsgs_from_userid > 0
UPDATE test.phpbbsw_privmsgs SET privmsgs_from_userid = privmsgs_from_userid - 28 WHERE privmsgs_from_userid > 0
Altering dependent table: topics_watch : user_id (offset = 213)
UPDATE test.phpbbsw_topics_watch SET user_id = user_id + 26 + 213 WHERE user_id > 0
UPDATE test.phpbbsw_topics_watch SET user_id = user_id - 26 WHERE user_id > 0
Altering dependent table: vote_voters : vote_user_id (offset = 213)
UPDATE test.phpbbsw_vote_voters SET vote_user_id = vote_user_id + 28 + 213 WHERE vote_user_id > 0
UPDATE test.phpbbsw_vote_voters SET vote_user_id = vote_user_id - 28 WHERE vote_user_id > 0
Shifting IDs in table ranks
UPDATE test.phpbbsw_ranks SET rank_id = rank_id + 2 + 7 WHERE rank_id > 0
UPDATE test.phpbbsw_ranks SET rank_id = rank_id - 2 WHERE rank_id > 0
Altering dependent table: users : user_rank (offset = 7)
UPDATE test.phpbbsw_users SET user_rank = user_rank + 1 + 7 WHERE user_rank > 0
UPDATE test.phpbbsw_users SET user_rank = user_rank - 1 WHERE user_rank > 0
Shifting IDs in table vote_desc
UPDATE test.phpbbsw_vote_desc SET vote_id = vote_id + 4 + 39 WHERE vote_id > 0
UPDATE test.phpbbsw_vote_desc SET vote_id = vote_id - 4 WHERE vote_id > 0
Altering dependent table: vote_voters : vote_id (offset = 39)
UPDATE test.phpbbsw_vote_voters SET vote_id = vote_id + 4 + 39 WHERE vote_id > 0
UPDATE test.phpbbsw_vote_voters SET vote_id = vote_id - 4 WHERE vote_id > 0
Altering dependent table: vote_results : vote_id (offset = 39)
UPDATE test.phpbbsw_vote_results SET vote_id = vote_id + 4 + 39 WHERE vote_id > 0
UPDATE test.phpbbsw_vote_results SET vote_id = vote_id - 4 WHERE vote_id > 0
Merging categories table:
SQL Error : 1146 Table 'test.phpbb_phpbb_categories' doesn't exist
INSERT INTO test.phpbb_phpbb_categories (cat_id, cat_title, cat_order) SELECT cat_id, cat_title, cat_order from test.phpbbsw_phpbb_categories
Line : 277
File : /home/firejack/public_html/merge.php
Code: Select all
$dbms = 'mysql';
$phpbb_root_path = '';
$dbhost = 'localhost';
$dbuser = 'firejack';
$dbpasswd = 'password';
// Name and prefix for the database that should keep the original IDs
$dbname1 = 'test';
$table_prefix1 = 'phpbb_';
// Name and prefix for the database that is going to be added
// to DB1.
$dbname2 = 'test';
$table_prefix2 = 'phpbbsw_';
Firejack wrote: Merging categories table:
SQL Error : 1146 Table 'test.phpbb_phpbb_categories' doesn't exist
Thanks for any help.
Firejack wrote: Hello
I've been testing this script but it doesn't want to seem to work for me. This is the output from when I run the script.
$dbms = 'mysql';
$phpbb_root_path = '';
$dbhost = 'localhost';
$dbuser = 'firejack';
$dbpasswd = 'password';
// Name and prefix for the database that should keep the original IDs
$dbname1 = 'test';
$table_prefix1 = 'phpbb_';
// Name and prefix for the database that is going to be added
// to DB1.
$dbname2 = 'test';
$table_prefix2 = 'phpbbsw_';[/code]
Any ideas why the script ends up trying to write DB2 to a double prefixed table,
Merging categories table:
SQL Error : 1146 Table 'test.phpbb_phpbb_categories' doesn't exist
Thanks for any help.