Junction of Forum's

The 2.0.x discussion forum has been locked; this will remain read-only. The 3.0.x discussion forum has been renamed phpBB Discussion.
User avatar
Anjay
Registered User
Posts: 66
Joined: Sat Dec 29, 2001 8:58 pm
Location: France
Contact:

Post by Anjay »

@ psoTFX

I know, I know, it's just its kinda hard to get it working with the limited info
he provided, but I'll back off now about the readme. ;)

Sorry if I was a bit off about the readme file.
User avatar
Manshu
Registered User
Posts: 127
Joined: Sun Dec 15, 2002 3:37 pm

Post by Manshu »

O.k.. after having tried 2 diffrent pepole do it, Ive come to a conclusion "If you wanna get it done, you better do it yourself!"

So yes I did it by hand :)
~felix
Registered User
Posts: 28
Joined: Tue Aug 20, 2002 1:10 am

Post by ~felix »

Alrite, so how do I do this? ... copy all that php onto a file and run it on my server?
User avatar
A_Jelly_Doughnut
Former Team Member
Posts: 34459
Joined: Sat Jan 18, 2003 1:26 am
Location: Where the Rivers Run
Contact:

Post by A_Jelly_Doughnut »

Yes, sir.
A Donut's Blog
"Bach's Prelude (Cello Suite No. 1) is driving Indiana country roads in Autumn" - Ann Kish
~felix
Registered User
Posts: 28
Joined: Tue Aug 20, 2002 1:10 am

Post by ~felix »

whoa talk about errors, lol, if anyone here wants to help me (please) add me msn [email protected]
BartVB
Consultant
Consultant
Posts: 1288
Joined: Thu Aug 02, 2001 1:32 pm
Location: The Netherlands
Contact:

Post by BartVB »

I don't mind helping (on the board, no MSN) if you tell us exactly what you did, what you got and what you expected...
I Hate oversized sigs and Love Penguins :D
User avatar
Wombat[SmT]
Registered User
Posts: 61
Joined: Sun Oct 20, 2002 4:18 am
Location: Nirvana
Contact:

Post by Wombat[SmT] »

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. :P
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.


I wanted to do this too, but Bart's script has disappeared, when I click on it I get a 404 :( ...
Rocker's Union
Rockers of the World, Unite.
No Spring Chicken!
High School? We Think Not!
Firejack
Registered User
Posts: 11
Joined: Fri Aug 29, 2003 5:32 pm
Contact:

Post by Firejack »

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.
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


and this is what I've put in the configuration section of the script.

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_';
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.
Firejack
Registered User
Posts: 11
Joined: Fri Aug 29, 2003 5:32 pm
Contact:

Post by Firejack »

I've successfully used this script! Many thanks to Bart for this excellent script :)

I had to use a slight work around for the script to work for me.
I removed the phpbb_ prefix in DB1. This has the result of removing the double prefixing problem because my way of thinking was nothing + nothing = nothing ;)
After running the script it was a simple matter of inserting the table prefix phpbb_ into all my tables again.
Tristessa
Registered User
Posts: 3
Joined: Wed Dec 31, 2003 4:04 am

Post by Tristessa »

ok, I'm not going to pay $180 ... because all I want to know is where I put this script. Anyone (even a reg. member) know?

Thanks
User avatar
Manshu
Registered User
Posts: 127
Joined: Sun Dec 15, 2002 3:37 pm

Post by Manshu »

ive gotten to work this also.. :):)

GREAT SCRIPT BART, I will post my refined version, once I make it more professional.. with a readme and everything lol
6-Kid
Registered User
Posts: 6
Joined: Thu Feb 05, 2004 6:58 am
Location: on a chair

Post by 6-Kid »

Firejack wrote: Merging categories table:

SQL Error : 1146 Table 'test.phpbb_phpbb_categories' doesn't exist


:?:

Thanks for any help.


change this in the script to fix it :
in the part where it say's function merge_tables($table)

--- look for ---

$sql = "INSERT INTO $dbname1.$table_prefix1".$table." ($fieldlist) SELECT $fieldlist from $dbname2.$table_prefix2" . $table . $where;
if(!$db->sql_query($sql))
--- end look ---

-- change --

$sql = "INSERT INTO $dbname1.".$table." ($fieldlist) SELECT $fieldlist from $dbname2." . $table . $where;

-- end change --

that's how i got it to work..
slash lickme
avis2004
Registered User
Posts: 5
Joined: Wed Feb 18, 2004 1:40 pm

Post by avis2004 »

Does this works with phpbb 2.0.6 and 2.0.4 ?

Thanks!
User avatar
A_Jelly_Doughnut
Former Team Member
Posts: 34459
Joined: Sat Jan 18, 2003 1:26 am
Location: Where the Rivers Run
Contact:

Post by A_Jelly_Doughnut »

It should, but upgrading the 2.0.4 board would help ensure it :)
A Donut's Blog
"Bach's Prelude (Cello Suite No. 1) is driving Indiana country roads in Autumn" - Ann Kish
haravinth
Registered User
Posts: 25
Joined: Tue Dec 03, 2002 1:42 am

Post by haravinth »

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.


you have to have 2 different database name. I don;t think you can have 2 database that are same name.
Locked

Return to “2.0.x Discussion”