Merge two phpbb3 forums

Converting from other board software? Good decision! Need help? Have a question about a convertor? Wish to offer a convertor package? Post here.
Scam Warning
User avatar
brudertorgen
Registered User
Posts: 28
Joined: Wed Jan 07, 2009 2:47 pm
Location: Kleines Dorf bei Kiel

Re: Merge two phpbb3 forums

Post by brudertorgen » Thu Dec 16, 2010 8:56 am

Hello alargeau,

1. your imported users were deactivated ? Did you do this here:
" ...(optional): deactivate the added users:
update phpbb_users_2 set user_type = 1 where user_id_old is null; ..."

? If yes: it behaves as wanted.

2. your problem with the visibility of your subforums is described in the dialog with Lucas1510 (and skinofstars), who had the same problem (this problem is by default). All imported forums have to get new permissions. Even admins can't see the imported forums. As this easily can be done in the ACP, I didn't implement it in the code.

All subforums have different IDs ? I hope so, otherwise I can't imagine how it shall work. So manually changing the forum IDs looks like a very bad thing for me !!
All Forum IDs are set correctly through the script (what may be corrected manually afterwards is the tree structure (do it with the stk as skinofstars described), but I never did it and never had problems).

If you really changed forum ids in the database, I suggest to do the whole merge process again, then rebuild search index, clear cache and reset permissions on a forum you miss. After setting the permissions this hidden forum should appear again. If you can see this, correct all the other forums (what can be very easy with inheritance ore more work if you use many different permissions).

alargeau
Registered User
Posts: 27
Joined: Sun Aug 22, 2010 2:59 am

Re: Merge two phpbb3 forums

Post by alargeau » Thu Dec 16, 2010 10:03 am

Hello and thanks for your reply!
1. I'm pretty sure I did everything. But now it's fine, I just activated them in the ACP. So, problem solved.

2. Yes, I had a look at the discussion even though I don't understand German but I did what you told him about permissions (I admit I saw that afterwards...). And it worked, I can now see all forums and subforums. And yes, I did change the ids of the subforums only because they weren't matching the parent forum ids. I mean in the ACP I could see the subforums but I couldn't edit them because the id of the parent forum and the id of the subforums were different, whereas my logical mind thought they should be the same. In short, subforums had a different id than their forum parent, that's why I couldn't edit them in the ACP and got an error on doing so (something like "the idXXX doesn't exist"). So, I changed that manually and copied the ids from the parent forums to the subforums and it worked. I can now see subforums plus I can edit them as usual.
So, on the index page, I can see all the forums (good), I can see the subforums too (good). When I click on a subforum, I can see the topics but when I click on a topic (from a subforum, hope you're still following me), it doesn't show anything. I just have a blank page just like if the topic was empty. What's strange is that I don't get any error whatsoever, I just have an empty page. So my guess is that the subforums topics still have the same ids as the subforums themselves had before. And if I understand it right, the subforums topics should have the same parent forum id than the subforums and than the parent forums. Yes, I know, it's hard to explain.

User avatar
brudertorgen
Registered User
Posts: 28
Joined: Wed Jan 07, 2009 2:47 pm
Location: Kleines Dorf bei Kiel

Re: Merge two phpbb3 forums

Post by brudertorgen » Thu Dec 16, 2010 8:40 pm

So you are the first who did a migration by hand (if this is a correct engl. term) ?!

Hm, I understand what you did but absolutely not why.

All IDs are correctly changed through the sql statements, so if you had to 'correct' them you must have done something wrong (why should you be the only one with this special problem ?).

What I think is if you click on a topic and see nothing, then maybe you don't have a post with this topic's id ?!

What else can be is that something changed with the new board version. Maybe the stk repair must be done now ?

FreeBaGeL
Registered User
Posts: 76
Joined: Wed Mar 23, 2005 8:50 pm

Re: Merge two phpbb3 forums

Post by FreeBaGeL » Mon Apr 04, 2011 3:33 am

Does this work with 3.0.8?

berni23
Registered User
Posts: 102
Joined: Mon Oct 10, 2005 1:12 pm

Re: Merge two phpbb3 forums

Post by berni23 » Mon Apr 11, 2011 8:24 am

sorry wrong thread

User avatar
brudertorgen
Registered User
Posts: 28
Joined: Wed Jan 07, 2009 2:47 pm
Location: Kleines Dorf bei Kiel

Re: Merge two phpbb3 forums

Post by brudertorgen » Thu Apr 14, 2011 2:40 pm

FreeBaGeL wrote:Does this work with 3.0.8?
Hello FreeBaGeL,

I did not try it with 3.0.8, but I guess it works. I don't think the table structure is too different.

What I wanted to describe is a way to merge several forums and this way still works.

berni23
Registered User
Posts: 102
Joined: Mon Oct 10, 2005 1:12 pm

Re: Merge two phpbb3 forums

Post by berni23 » Wed Apr 20, 2011 7:57 am

Thx for this great tutorial!
I used it with 2 phpBB 3.0.8 boards and everything went ok.
Well, almost:
For users present on both forums everything seems fine, but users present only on the destination board can't see any boards.

Anybody have an idea?

User avatar
brudertorgen
Registered User
Posts: 28
Joined: Wed Jan 07, 2009 2:47 pm
Location: Kleines Dorf bei Kiel

Re: Merge two phpbb3 forums

Post by brudertorgen » Fri Apr 29, 2011 11:29 am

Hello berni23,

I think there are 2 possibilities:
1) check the permissions of the forums and the assingment of groups / users. Normally users of the source forum (those who are transferred into the destination forum) can't see the forums of the destination (because of group mismatch), but maybe here is the problem the other way.
2) read zeugmas posts, he forgot one statement and had a similar problem

Please report if you have updated information.

User avatar
abertoll
Registered User
Posts: 84
Joined: Fri Jan 21, 2005 5:13 am
Contact:

Re: Merge two phpbb3 forums

Post by abertoll » Fri May 20, 2011 10:49 pm

I'm looking into your method here because I tried making a script to merge 2 boards, and it seems to fail. I tried merging one board with itself, and I expected to find double the posts, etc. but I found instead the boards were exactly the same. Actually, if I look at the database there are an increased number of records in the posts table, but the site generates an error. Then if I go to resync the forum, the extra posts are deleted somehow. Maybe I'm getting messed up with auto-increment.

Since this is reported to work, I was wondering if you have any advice or if you're at all interested in helping me develop this script.

User avatar
brudertorgen
Registered User
Posts: 28
Joined: Wed Jan 07, 2009 2:47 pm
Location: Kleines Dorf bei Kiel

Re: Merge two phpbb3 forums

Post by brudertorgen » Mon May 30, 2011 12:27 pm

Hello abertoll,

when I developed this method I had only to merge forums one time, I never wanted the effort to script or automate something. There were / are automated / scripted solutions here in the forum, but they don't seem to work in every case or with every version.

So I posted my own solution with the whole code to show how the merge works, so that everyone can modify / adapt the code easily. Every automatic method has the disadvantage that for the end user it either works or not, he can't change it.

Scripting / programming something requires an understanding of what is coded. Maybe you should first go through the merge process manually and then scipt it.

As you can see here, every posted problem was a 'mistake' in usage (forgotten code line or something like this), this points out:
a) if you work correctly , the merge will work
b) an working automated routine would help avoiding these mistakes

The only problem after the merge is 'hidden content', but this is by design (and - in my case - wanted), because no group permissions are migrated. If the admin resets the persmissions, this 'problem' will be solved

In what language do you want to code the script ? If you have something ready or in developement, I woult be proud of reading (and commenting) it :)

User avatar
abertoll
Registered User
Posts: 84
Joined: Fri Jan 21, 2005 5:13 am
Contact:

Re: Merge two phpbb3 forums

Post by abertoll » Mon May 30, 2011 8:14 pm

brudertorgen wrote: Scripting / programming something requires an understanding of what is coded. Maybe you should first go through the merge process manually and then scipt it.
Yes, after my script did not work, I decided I probably would try yours and maybe start over with a script if needed. Anyway, I will post what I tried here. Basically I started by trying to identify what I thought would be the important tables, and then define the foreign key connections between them as that would be the "logical" way to do a merge.

NOTE TO PEOPLE READING: THIS DOES NOT WORK

config.php:

Code: Select all

$dbhost="";
$dbname="";
$dbuser="";
$dbpasswd="";
$db1="phpbb3_";
$db2="db2_";
$db3="db3_";

$nametag=".2";  // For duplicate names, will tag names imported from db2
excludeusers.php:

Code: Select all

// Exclude these users (bots, etc.) by pattern

$excludepat[] = "%Google%";
$excludepat[] = "%Bot%";
$excludepat[] = "%Spider%";
$excludepat[] = "%Crawler%";
$excludepat[] = "MSN%";
$excludepat[] = "%Validator%";
$excludepat[] = "%search%";
$excludepat[] = "W3C%";
keymap.php:

Code: Select all

$pkey['attachments']="attach_id";
$fkey['attachments']=array(
        "post_msg_id" => "posts",
        "topic_id" => "topics",
        "poster_id" => "users"
);

$pkey['banlist']="ban_id";

$pkey['drafts']="draft_id";
$fkey['drafts']=array(
        "user_id" => "users",
        "topic_id" => "topics",
        "forum_id" => "forums"
);

$pkey['forums']="forum_id";
$fkey['forums']=array(
        "parent_id" => "forums",
        "left_id" => "forums",
        "right_id" => "forums"
);

$fkey['forums_access']=array(
        "forum_id" => "forums",
        "user_id" => "users"
);

$fkey['forums_track']=array(
        "forum_id" => "forums",
        "user_id" => "users"
);

$fkey['forums_watch']=array(
        "forum_id" => "forums",
        "user_id" => "users"
);


$pkey['log']="log_id";
$fkey['log']=array(
        "user_id" => "users",
        "forum_id" => "forums",
        "topic_id" => "topics",
        "reportee_id" => "users"
);

$pkey['poll_options']="poll_option_id";
$fkey['poll_options']=array(
        "topic_id" => "topics"
);

$fkey['poll_votes']=array(
        "topic_id" => "topics",
        "poll_option_id" => "poll_options"
);

$pkey['posts']="post_id";
$fkey['posts']=array(
        "topic_id" => "topics",
        "forum_id" => "forums",
        "poster_id" => "users",
        "icon_id" => 0
);

$pkey['privmsgs']="msg_id";
$fkey['privmsgs']=array(
        "author_id" => "users",
        "icon_id" => 0
);

$pkey['privmsgs_folder']="folder_id";
$fkey['privmsgs_folder']=array(
        "user_id" => "users"
);

$pkey['privmsgs_rules']="rule_id";
$fkey['privmsgs_rules']=array(
        "user_id" => "users"
);

$fkey['privmsgs_to']=array(
        "msg_id" => "privmsgs",
        "user_id" => "users",
        "author_id" => "users",
        "folder_id" => "privmsgs_folder"
);

$pkey['ranks']="rank_id";

$pkey['topics']="topic_id";
$fkey['topics']=array(
        "forum_id" => "forums",
        "icon_id" => 0,
        "topic_first_post_id" => "posts",
        "topic_last_post_id" => "posts",
        "topic_last_poster_id" => "users",
        "topic_moved_id" => "topics"
);

$fkey['topics_posted']=array(
        "user_id" => "users",
        "topic_id" => "topics"
);

$fkey['topics_track']=array(
        "user_id" => "users",
        "topic_id" => "topics",
        "forum_id" => "forums"
);

$fkey['topics_posted']=array(
        "user_id" => "users",
        "topic_id" => "topics"
);

$pkey['users']="user_id";
$fkey['users']=array(
        "user_rank" => "ranks"
);

$pkey['warnings']="warning_id";
$fkey['warnings']=array(
        "user_id" => "users",
        "post_id" => "posts",
        "log_id" => "log"
);

$fkey['zebra']=array(
        "user_id" => "users",
        "zebra_id" => "users"
);
merge.php:

Code: Select all

<html>
<body style="font-size: 80%;">

<h1>phpBB3 Merge Script</h1>

<pre>
<?php

require("config.php");
require("keymap.php");
require("excludeusers.php");

echo "Primary DB (db1): $db1\n";
echo "DB to merge (db2): $db2\n";
echo "Merged DB (db3): $db3\n";
echo "Duplicate usernames from db2 will be tagged with $nametag\n";

echo "<h2>(1) Checking defined key integrity</h2>";
foreach ($fkey as $table => $keys) {
        foreach ($keys as $key => $ref) {
                if ( isset($pkey["$ref"]) || ($ref === 0) ) {
                        echo "$key->$ref ok\n";
                } else {
                        die("Error on $key->$ref");
                }
        }
}

$mysqli = new mysqli($dbhost,$dbuser,$dbpasswd,$dbname);
if (mysqli_connect_errno()) die("Connect failed: ". mysqli_connect_error());

echo "<h2>(2) Determining offsets for primary keys on db1\n</h2>";
foreach ($pkey as $table => $key) {
        // Get the maximum value from db1 and add 100
        $db1table="$db1$table";
        $result = $mysqli->query("SELECT MAX($key) FROM $db1table");
        $row = $result->fetch_row();
        $max = 0;
        $max += $row[0];
        $offset = round($max + 10,-1);
        $inc["$table"]=$offset;
        echo "$table +$offset\n";
}

echo "<h2>(3) Copying db2 to db3\n</h2>";
foreach ($fkey as $table => $keys) {
        $db2table = "$db2$table";
        $db3table = "$db3$table";
        $mysqli->query("DROP TABLE IF EXISTS $db3table");
        // $mysqli->query("CREATE TABLE $db3table LIKE $db2table");
        $mysqli->query("CREATE TABLE $db3table SELECT * FROM $db2table");
        echo "$db2table -> $db3table\n";
}
foreach ($pkey as $table => $key) {
        $db2table = "$db2$table";
        $db3table = "$db3$table";
        $mysqli->query("DROP TABLE IF EXISTS $db3table");
        // $mysqli->query("CREATE TABLE $db3table LIKE $db2table");
        $mysqli->query("CREATE TABLE $db3table SELECT * FROM $db2table");
        echo "$db2table -> $db3table\n";
}

echo "<h2>(4) Incrementing items in db3\n</h2>";
foreach ($pkey as $table => $field) {
        $db3table="$db3$table";
        $offset=$inc["$table"];
        $mysqli->query("UPDATE $db3table SET $field=$field+$offset");
        echo "PK $db3table.$field +$offset\n";
}
foreach ($fkey as $table => $keys) {
        $db3table="$db3$table";
        foreach ($keys as $field => $ref) {
                if ($ref === 0) {
                        $mysqli->query("UPDATE $db3table SET $field=0");
                        echo "FK $db3table.$field =0\n";
                } else {
                        $offset=$inc["$ref"];
                        $mysqli->query("UPDATE $db3table SET $field=$field+$offset");
                        echo "FK $db3table.$field +$offset\n";
                }
        }
}
echo "<h2>(5) Resolving duplicate users\n</h2>";

echo "Deleting excluded users (bots, etc.): ";
$query = "DELETE from ${db3}users WHERE ";
foreach ($excludepat as $userpat) {
        echo "$userpat ";
        $query .= "username LIKE '$userpat' OR ";
}
echo "\n";
$query .= "username IS NULL";
$mysqli->query($query);

$query = "SELECT db1.username, db1.user_id, db3.user_id "
        ."FROM ${db1}users db1 INNER JOIN ${db3}users db3 "
        ."ON db1.user_email = db3.user_email "
        ."WHERE ( db1.user_email LIKE '%@%' OR db3.username = 'Anonymous' ) "
        ."AND db1.username = db3.username "
        ."ORDER BY db1.user_id";
$result = $mysqli->query($query);
while ($row = $result->fetch_row()) {
        echo "Map user $row[0]($row[2]) to $row[1]\n";
        $usermap[$row[2]] = $row[1];
}

foreach ($fkey as $table => $keys) {
        foreach ($keys as $key => $ref) {
                if ($ref === "users") {
                        $db3table = "$db3$table";
                        echo "Updating $db3table $key\n";
                        foreach ($usermap as $user => $update) {
                                $mysqli->query("UPDATE $db3table SET $key = $update WHERE $key = $user");
                        }
                }
        }
}

echo "Deleting duplicate users: ";
$output = "";
foreach ($usermap as $user => $update) {
        $output .= "$user ";
        $mysqli->query("DELETE from ${db3}users WHERE user_id = $user");
}
echo wordwrap($output)."\n";

// For every user where username is the same, change the username
echo "Fixing leftover duplicate usernames\n";
$query = "SELECT db1.username FROM  ${db1}users db1 INNER JOIN ${db3}users db3 ON db1.username = db3.username";
$result = $mysqli->query($query);
while ($row = $result->fetch_row()) {
        echo "$row[1] -> $row[1]$nametag\n";
}
$query = "UPDATE ${db1}users db1 INNER JOIN ${db3}users db3 ON db1.username = db3.username SET db3.username = CONCAT(db3.username,'$nametag')";
$result = $mysqli->query($query);


echo "<h2>(6) Importing data from db1 to db3\n</h2>";
// Probably want to query using "show" to get all tables and do the copy or else just do this part by hand.

$result = $mysqli->query("SHOW TABLES LIKE '$db1%'");
while ($row = $result->fetch_row()) {
        $table = str_replace($db1,"",$row[0]); // remove the db1 prefix
        $db1table = $db1.$table;
        $db3table = $db3.$table;
        echo "Copying $db1table to $db3table\n";
        $mysqli->query("CREATE TABLE IF NOT EXISTS $db3table LIKE $db1table");
        $mysqli->query("INSERT INTO $db3table SELECT * FROM $db1table");
}

$mysqli->close();
?>
</pre>

</body>
</html>
At this point, I think it might be easier for me to just take your instructions and start over. (Unless you see an obvious mistake that might just fix everything.)

User avatar
abertoll
Registered User
Posts: 84
Joined: Fri Jan 21, 2005 5:13 am
Contact:

Re: Merge two phpbb3 forums

Post by abertoll » Mon May 30, 2011 8:19 pm

Here is typical output, if this helps:

Code: Select all

phpBB3 Merge Script

Primary DB (db1): phpbb3_
DB to merge (db2): db2_
Merged DB (db3): db3_
Duplicate usernames from db2 will be tagged with .WFI
(1) Checking defined key integrity
post_msg_id->posts ok
topic_id->topics ok
poster_id->users ok
user_id->users ok
topic_id->topics ok
forum_id->forums ok
parent_id->forums ok
left_id->forums ok
right_id->forums ok
forum_id->forums ok
user_id->users ok
forum_id->forums ok
user_id->users ok
forum_id->forums ok
user_id->users ok
user_id->users ok
forum_id->forums ok
topic_id->topics ok
reportee_id->users ok
topic_id->topics ok
topic_id->topics ok
poll_option_id->poll_options ok
topic_id->topics ok
forum_id->forums ok
poster_id->users ok
icon_id->0 ok
author_id->users ok
icon_id->0 ok
user_id->users ok
user_id->users ok
msg_id->privmsgs ok
user_id->users ok
author_id->users ok
folder_id->privmsgs_folder ok
forum_id->forums ok
icon_id->0 ok
topic_first_post_id->posts ok
topic_last_post_id->posts ok
topic_last_poster_id->users ok
topic_moved_id->topics ok
user_id->users ok
topic_id->topics ok
user_id->users ok
topic_id->topics ok
forum_id->forums ok
user_rank->ranks ok
user_id->users ok
post_id->posts ok
log_id->log ok
user_id->users ok
zebra_id->users ok
(2) Determining offsets for primary keys on db1
attachments +30
banlist +90
drafts +10
forums +50
log +860
poll_options +20
posts +10060
privmsgs +2510
privmsgs_folder +200
privmsgs_rules +10
ranks +50
topics +930
users +1380
warnings +10
(3) Copying db2 to db3
db2_attachments -> db3_attachments
db2_drafts -> db3_drafts
db2_forums -> db3_forums
db2_forums_access -> db3_forums_access
db2_forums_track -> db3_forums_track
db2_forums_watch -> db3_forums_watch
db2_log -> db3_log
db2_poll_options -> db3_poll_options
db2_poll_votes -> db3_poll_votes
db2_posts -> db3_posts
db2_privmsgs -> db3_privmsgs
db2_privmsgs_folder -> db3_privmsgs_folder
db2_privmsgs_rules -> db3_privmsgs_rules
db2_privmsgs_to -> db3_privmsgs_to
db2_topics -> db3_topics
db2_topics_posted -> db3_topics_posted
db2_topics_track -> db3_topics_track
db2_users -> db3_users
db2_warnings -> db3_warnings
db2_zebra -> db3_zebra
db2_attachments -> db3_attachments
db2_banlist -> db3_banlist
db2_drafts -> db3_drafts
db2_forums -> db3_forums
db2_log -> db3_log
db2_poll_options -> db3_poll_options
db2_posts -> db3_posts
db2_privmsgs -> db3_privmsgs
db2_privmsgs_folder -> db3_privmsgs_folder
db2_privmsgs_rules -> db3_privmsgs_rules
db2_ranks -> db3_ranks
db2_topics -> db3_topics
db2_users -> db3_users
db2_warnings -> db3_warnings
(4) Incrementing items in db3
PK db3_attachments.attach_id +30
PK db3_banlist.ban_id +90
PK db3_drafts.draft_id +10
PK db3_forums.forum_id +50
PK db3_log.log_id +860
PK db3_poll_options.poll_option_id +20
PK db3_posts.post_id +10060
PK db3_privmsgs.msg_id +2510
PK db3_privmsgs_folder.folder_id +200
PK db3_privmsgs_rules.rule_id +10
PK db3_ranks.rank_id +50
PK db3_topics.topic_id +930
PK db3_users.user_id +1380
PK db3_warnings.warning_id +10
FK db3_attachments.post_msg_id +10060
FK db3_attachments.topic_id +930
FK db3_attachments.poster_id +1380
FK db3_drafts.user_id +1380
FK db3_drafts.topic_id +930
FK db3_drafts.forum_id +50
FK db3_forums.parent_id +50
FK db3_forums.left_id +50
FK db3_forums.right_id +50
FK db3_forums_access.forum_id +50
FK db3_forums_access.user_id +1380
FK db3_forums_track.forum_id +50
FK db3_forums_track.user_id +1380
FK db3_forums_watch.forum_id +50
FK db3_forums_watch.user_id +1380
FK db3_log.user_id +1380
FK db3_log.forum_id +50
FK db3_log.topic_id +930
FK db3_log.reportee_id +1380
FK db3_poll_options.topic_id +930
FK db3_poll_votes.topic_id +930
FK db3_poll_votes.poll_option_id +20
FK db3_posts.topic_id +930
FK db3_posts.forum_id +50
FK db3_posts.poster_id +1380
FK db3_posts.icon_id =0
FK db3_privmsgs.author_id +1380
FK db3_privmsgs.icon_id =0
FK db3_privmsgs_folder.user_id +1380
FK db3_privmsgs_rules.user_id +1380
FK db3_privmsgs_to.msg_id +2510
FK db3_privmsgs_to.user_id +1380
FK db3_privmsgs_to.author_id +1380
FK db3_privmsgs_to.folder_id +200
FK db3_topics.forum_id +50
FK db3_topics.icon_id =0
FK db3_topics.topic_first_post_id +10060
FK db3_topics.topic_last_post_id +10060
FK db3_topics.topic_last_poster_id +1380
FK db3_topics.topic_moved_id +930
FK db3_topics_posted.user_id +1380
FK db3_topics_posted.topic_id +930
FK db3_topics_track.user_id +1380
FK db3_topics_track.topic_id +930
FK db3_topics_track.forum_id +50
FK db3_users.user_rank +50
FK db3_warnings.user_id +1380
FK db3_warnings.post_id +10060
FK db3_warnings.log_id +860
FK db3_zebra.user_id +1380
FK db3_zebra.zebra_id +1380
(5) Resolving duplicate users
Deleting excluded users (bots, etc.): %Google% %Bot% %Spider% %Crawler% MSN% %Validator% %search% W3C% 
Map user Anonymous(1381) to 1
Updating db3_attachments poster_id
Updating db3_drafts user_id
Updating db3_forums_access user_id
Updating db3_forums_track user_id
Updating db3_forums_watch user_id
Updating db3_log user_id
Updating db3_log reportee_id
Updating db3_posts poster_id
Updating db3_privmsgs author_id
Updating db3_privmsgs_folder user_id
Updating db3_privmsgs_rules user_id
Updating db3_privmsgs_to user_id
Updating db3_privmsgs_to author_id
Updating db3_topics topic_last_poster_id
Updating db3_topics_posted user_id
Updating db3_topics_track user_id
Updating db3_warnings user_id
Updating db3_zebra user_id
Updating db3_zebra zebra_id
Deleting duplicate users: 1381 
Fixing leftover duplicate usernames
(6) Importing data from db1 to db3
Copying phpbb3_acl_groups to db3_acl_groups
Copying phpbb3_acl_options to db3_acl_options
Copying phpbb3_acl_roles to db3_acl_roles
Copying phpbb3_acl_roles_data to db3_acl_roles_data
Copying phpbb3_acl_users to db3_acl_users
Copying phpbb3_attachments to db3_attachments
Copying phpbb3_banlist to db3_banlist
Copying phpbb3_bbcodes to db3_bbcodes
Copying phpbb3_bookmarks to db3_bookmarks
Copying phpbb3_bots to db3_bots
Copying phpbb3_config to db3_config
Copying phpbb3_confirm to db3_confirm
Copying phpbb3_disallow to db3_disallow
Copying phpbb3_drafts to db3_drafts
Copying phpbb3_extension_groups to db3_extension_groups
Copying phpbb3_extensions to db3_extensions
Copying phpbb3_forums to db3_forums
Copying phpbb3_forums_access to db3_forums_access
Copying phpbb3_forums_track to db3_forums_track
Copying phpbb3_forums_watch to db3_forums_watch
Copying phpbb3_groups to db3_groups
Copying phpbb3_icons to db3_icons
Copying phpbb3_lang to db3_lang
Copying phpbb3_log to db3_log
Copying phpbb3_moderator_cache to db3_moderator_cache
Copying phpbb3_modules to db3_modules
Copying phpbb3_poll_options to db3_poll_options
Copying phpbb3_poll_votes to db3_poll_votes
Copying phpbb3_posts to db3_posts
Copying phpbb3_privmsgs to db3_privmsgs
Copying phpbb3_privmsgs_folder to db3_privmsgs_folder
Copying phpbb3_privmsgs_rules to db3_privmsgs_rules
Copying phpbb3_privmsgs_to to db3_privmsgs_to
Copying phpbb3_profile_fields to db3_profile_fields
Copying phpbb3_profile_fields_data to db3_profile_fields_data
Copying phpbb3_profile_fields_lang to db3_profile_fields_lang
Copying phpbb3_profile_lang to db3_profile_lang
Copying phpbb3_ranks to db3_ranks
Copying phpbb3_reports to db3_reports
Copying phpbb3_reports_reasons to db3_reports_reasons
Copying phpbb3_search_results to db3_search_results
Copying phpbb3_search_wordlist to db3_search_wordlist
Copying phpbb3_search_wordmatch to db3_search_wordmatch
Copying phpbb3_sessions to db3_sessions
Copying phpbb3_sessions_keys to db3_sessions_keys
Copying phpbb3_sitelist to db3_sitelist
Copying phpbb3_smilies to db3_smilies
Copying phpbb3_styles to db3_styles
Copying phpbb3_styles_imageset to db3_styles_imageset
Copying phpbb3_styles_imageset_data to db3_styles_imageset_data
Copying phpbb3_styles_template to db3_styles_template
Copying phpbb3_styles_template_data to db3_styles_template_data
Copying phpbb3_styles_theme to db3_styles_theme
Copying phpbb3_topics to db3_topics
Copying phpbb3_topics_posted to db3_topics_posted
Copying phpbb3_topics_track to db3_topics_track
Copying phpbb3_topics_watch to db3_topics_watch
Copying phpbb3_user_group to db3_user_group
Copying phpbb3_users to db3_users
Copying phpbb3_warnings to db3_warnings
Copying phpbb3_words to db3_words
Copying phpbb3_zebra to db3_zebra

User avatar
brudertorgen
Registered User
Posts: 28
Joined: Wed Jan 07, 2009 2:47 pm
Location: Kleines Dorf bei Kiel

Re: Merge two phpbb3 forums

Post by brudertorgen » Mon Jun 06, 2011 7:13 pm

Hello abertoll,

I just tried to run your code in my php environment, but I only get warnings like

Code: Select all

...
(1) Checking defined key integrity


Warning:  Invalid argument supplied for foreach() in E:\XAMPP\xampplite\htdocs\mergescript\merge.php on line 19

(2) Determining offsets for primary keys on db1


Warning:  Invalid argument supplied for foreach() in E:\XAMPP\xampplite\htdocs\mergescript\merge.php on line 33

(3) Copying db2 to db3


Warning:  Invalid argument supplied for foreach() in E:\XAMPP\xampplite\htdocs\mergescript\merge.php on line 46



Warning:  Invalid argument supplied for foreach() in E:\XAMPP\xampplite\htdocs\mergescript\merge.php on line 54..
As I'm no php coder (and arrays are always mean for me :oops: ) and there are no comments in your code, I'm actually not capable of understanding it really :cry:

As this is not very helpful but your code idea seems to be a good thing for all, it really migth be the best if you merge two different boards and watch waht's happening. OR you describe what your code lines (shall) do.

You mentioned problems with auto increment: I delete the auto increment attribute in the merge process (if the data is uploaded to the real db (provider) than the auto inc will exist again)

Sorry, but this is all I can do azt the moment.

{S'PORT}_Skillz
Registered User
Posts: 284
Joined: Fri Aug 23, 2002 5:56 am

Re: Merge two phpbb3 forums

Post by {S'PORT}_Skillz » Tue Jul 19, 2011 10:37 pm

So this is confirmed to work on the latest builds of Phpbb 3? I am getting ready to merge two relatively small forums into one and want to make sure I'm not wasting my time. 8-)

User avatar
brudertorgen
Registered User
Posts: 28
Joined: Wed Jan 07, 2009 2:47 pm
Location: Kleines Dorf bei Kiel

Re: Merge two phpbb3 forums

Post by brudertorgen » Fri Jul 22, 2011 9:18 am

There is no 'Do it and enjoy' button, but I'm sure that - if I would do the merge - it will word with the newest version :). If you have problems you can ask for help.

Locked

Return to “[3.0.x] Convertors”