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.
Anti-Spam Guide
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 » Wed Sep 15, 2010 8:25 am

Hello all,

first: I didnt' expect that still somebody cares about this thread as for a while nothing happened here
second: I'm glad that with Dicky someone from the support team tries to help here !!
third: as some time passed, I already forgot most of what I did, so I have to try to remember :?

@alargeau
You call the 'msgto' procedure and get the error : ..yntax to use near 'update phpbb_privmsgs_2, phpbb_privmsgs_3 set phpbb_privmsgs_2.to_address = ph' at line 3 ?

Hm, this statement is not part of the procedure, so the error can't appear.
Maybe you try to execute the call statement and the folowing lines in one part. Please try to execute the statement:
call msgto.

Please tell me if this can be done successfully

If so, execute in a next step the following statement:
update phpbb_privmsgs_2, phpbb_privmsgs_3
set phpbb_privmsgs_2.to_address = phpbb_privmsgs_3.to_address
where phpbb_privmsgs_2.msg_id = phpbb_privmsgs_3.msg_id;


Problem with posts and red users:
1. I don't know, what red means (I don't use standard Style, so in my forum red means administrator, but that doesn't have to mean anything

What the script does:
It adds users form the 'old' forum to the new one (as new users).
Exeption: if both users in old and actual forum have the same name (username_clean) then this user is not added again but the information in the posts, pms, forums and topic from the old forum is updated, so the migrated content is mapped to the userid of the actual forum.
All other users are added as a new user and disabled by default.
One copied attribute is 'group_id'. Maybe the old value matches an existing group_id in the actual forum and has unwanted side effects. But even if now all users are admins (worst case), they are still disabled, so you must check the permissions and - if wanted - enable the uses(s)

If you can't see forums and topics even as administrator, you have to check the permissions on the transferred content (as discussed above with Lucas).

If this doesn'nt help AND you have successfully done all steps fom the 'guide', please tell me, if you have the problem with users that are in both forums with the same name and / or with users thar were in the old forum but not in the newer.

....

@Cassie396
Thanks a lot, I had the same problem and still can't believe that nobody wrote a GUI or something like that. There are millions of people who know more about phpbbX than me and even more who are better in php or htlm and at least thousands more who are better in sql. So why does nobody write an app ? Maybe it exists and we are only to stupid to find it :D

So , enough for one post, have to work...

zeugma
Registered User
Posts: 3
Joined: Sun Oct 03, 2010 9:38 am

Re: Merge two phpbb3 forums

Post by zeugma » Sun Oct 03, 2010 9:52 am

Hello,

I used this method to successfully merge two forums. Everything seems ok but one thing.

When you view a users profile and click on "search user's posts", it returns all posts from the old forum, even if the user searching posts doesn't have permissions for these forums. The user searching can not access the whole topic because of permissions, but can see the beginning of the post in the search result.

For other forums I create, the search skips forums where the user has no permissions, the issue seems to affect only imported ones.

I have tried to
* move the posts to another, newly created, forum within the board, without any permissions for these users
* deleting search cache
* recreating the search cache
* resetting everything else
* change search engine to fulltext mysql

But the posts still show up when clicking on "search user's posts".

I have looked through the permissions several times and the seem OK. It seems to be an issue with how user permissions are applied to posts.

If anyone could point me in the right direction I would be very glad!

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 Oct 14, 2010 11:21 am

Hello zeugma,

I tested it with 2 of my users as viewer. 1 normal user and 1 Admin. The result of the number of posts differed as it should. With this lillte test till now I can only say that with my forum I don't have this problem (or couldn't find it till now). But I'll check further.

Cassie396
Registered User
Posts: 87
Joined: Sun Dec 07, 2003 3:59 am

Re: Merge two phpbb3 forums

Post by Cassie396 » Sat Oct 23, 2010 10:17 pm

I've been trying to merge PMs from one board to another. Everything was going fine until I got to the procedure part of the code posted. Here's what happened...

I typed in:

Code: Select all

call msgto

update phpbb_privmsgs_2, phpbb_privmsgs_3
set phpbb_privmsgs_2.to_address = phpbb_privmsgs_3.to_address
where phpbb_privmsgs_2.msg_id = phpbb_privmsgs_3.msg_id;
and then I got:

Code: Select all

SQL query:

call msgto UPDATE phpbb_privmsgs_2,
phpbb_privmsgs_3 SET phpbb_privmsgs_2.to_address = phpbb_privmsgs_3.to_address WHERE phpbb_privmsgs_2.msg_id = phpbb_privmsgs_3.msg_id

MySQL said: Documentation
#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'update phpbb_privmsgs_2, phpbb_privmsgs_3
set phpbb_privmsgs_2.to_address = php' at line 3 

I read through the thread, and tried to just call the procedure.

Code: Select all

call msgto
And then I got:
SQL query:

call msgto

Code: Select all

MySQL said: Documentation
#1329 - No data - zero rows fetched, selected, or processed 

Any thoughts on what I should try to do?

Thank you!

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 Oct 28, 2010 12:47 pm

Hello Cassie396,

I would try - just for examining the problem - to execute the statemenst step by step.

1. are there tables called 'phpbb_privmsgs_2' (with data in it) and 'phpbb_privmsgs_3' (with no data)
2. did you correctly change the value from 'touser'
3. post the first lines from the result of 'select msg_id, to_address, bcc_address from phpbb_privmsgs_2;' . If there is sensitive data, please mask or encode it.

zeugma
Registered User
Posts: 3
Joined: Sun Oct 03, 2010 9:38 am

Re: Merge two phpbb3 forums

Post by zeugma » Tue Nov 02, 2010 12:37 pm

Hello Brudertorgen,

I tried to PM you, but to do that this board requires me to post at least 5 messages.

Could you please PM me so I could answer, I would be happy if you wrote me your e-mail in the PM. If we could establish e-mail-contact, perhaps you could then log in to my forum and test it?

Regards
Johan

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 » Wed Nov 10, 2010 1:58 pm

Hello zeugma,

althouh I can't promise anything (my intention creating this thread was just to demonstrate a solution, I never though of support) I'll pm you. My problem is very simple: time. But I'll see, maybe I can help.

Cassie396
Registered User
Posts: 87
Joined: Sun Dec 07, 2003 3:59 am

Re: Merge two phpbb3 forums

Post by Cassie396 » Sun Nov 21, 2010 3:07 pm

Hi there, I tried some of your suggestions... here's what I got.
I would try - just for examining the problem - to execute the statemenst step by step.
Any time I enter any of the lines I get an SQL syntax error. I can't get anything to go through in this step. They all pretty much bring up an error like this:
#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'update phpbb_privmsgs_2, phpbb_privmsgs_3' at line 3
Although, I'm not familiar with running SQL queries, I rely on copying & pasting to do all of this. Do I need to add semicolons, or is there a special way to separate out these queries?
are there tables called 'phpbb_privmsgs_2' (with data in it) and 'phpbb_privmsgs_3' (with no data)
Yes. The 'phpbb_privmsgs_3' database had data in it, so I deleted it, recreated it and tried to run the procedure again. No luck.
did you correctly change the value from 'touser'
Yes. I used the max user_id when setting up the procedure.
post the first lines from the result of 'select msg_id, to_address, bcc_address from phpbb_privmsgs_2;' . If there is sensitive data, please mask or encode it.
I don't know if this is what you meant...?

Code: Select all

Full Texts  	msg_id 	to_address 	bcc_address
	Edit 	Delete 	42287 	[BLOB - 4 B] 	[BLOB - 0 B]
	Edit 	Delete 	42288 	[BLOB - 0 B] 	[BLOB - 3 B]
	Edit 	Delete 	42290 	[BLOB - 4 B] 	[BLOB - 0 B]
	Edit 	Delete 	42291 	[BLOB - 3 B] 	[BLOB - 0 B]
	Edit 	Delete 	42292 	[BLOB - 4 B] 	[BLOB - 0 B]
	Edit 	Delete 	42383 	[BLOB - 4 B] 	[BLOB - 0 B]
If you or if you know anyone who might be willing to do this for me at a reasonable fee, I would seriously consider it at this point.

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 Nov 25, 2010 3:26 pm

Hm,

if your two forums are of the same version and not too big in size, maybe I could try a test merge. If I know the way, we could do the final merge and go life on another day ?!

zeugma
Registered User
Posts: 3
Joined: Sun Oct 03, 2010 9:38 am

Re: Merge two phpbb3 forums

Post by zeugma » Sat Nov 27, 2010 8:34 am

I am very thankful for BruderTorgen taking his time and supporting me with this! With his help, my problems are now solved.

It seems as if I missed a part in the merging process. In my posts table, the forum_id hadn't been updated.

The following SQL solved the issue:

Code: Select all

UPDATE posts p SET forum_id = (SELECT forum_id FROM topics t WHERE t.topic_id = p.topic_id);
Afterwards I also had to rebuild the search index and resynchronise the statistics and post counts.

Thanks alot!

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 » Sun Nov 28, 2010 10:59 am

Hello zeugma,

great that you found the sql statement by yourself, so I don't have to do it (puh) :D

Very interesting to 'read' posts in swedish with no chance to understand what they mean (and to remeber the sql output (it's much easier to compare search results if you understand them)).

I'm glad that I could find the time and was able to help you.

Whyever the same ids are stored in different tables several times, maybe performance reasons ?!

skinofstars
Registered User
Posts: 9
Joined: Fri Jan 04, 2008 4:36 am

Re: Merge two phpbb3 forums

Post by skinofstars » Wed Dec 08, 2010 7:41 pm

Hi,

Just wanted to say thanks for posting this guide. I had some initial bemuse before I realised that the forums were hidden (ACP->Forums tab). I also had some problems with ordering the merged forums within the existing board structure. Seems my tree structure wasn't right, but I'm pretty sure I just cocked that up myself. In trying to fix this (and other problems) I came across the Support Toolkit (http://www.phpbb.com/support/stk/), which I can't believe I hadn't heard of before. Anyway, STk has a binary tree repair script, so that was that.

So, thanks again to brudertorgen. Great guide :)

Kevin

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 09, 2010 2:46 pm

Thank you, skinofstars. It's a pleasure for me to see that I could help someone with my post. Although I know the stk and I'm sure that my binary tree is absolutely chaotic it seems to have no effect. It certainly is a good idea to use this tool kit.

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

Re: Merge two phpbb3 forums

Post by alargeau » Mon Dec 13, 2010 8:31 pm

Hello everyone,

So, I've done the necessary (except for the PMs) again (the first time it crashed so I had to put everything back but now I really want to do the merge). First, I realized that all the users from the source forum were inactive. I activated them and now I can see them. I can also see their posts count but I can't see their posts. I've got an error "No suitable matches were found". I checked the database and the posts are there. Then I checked the forums because I couldn't see them (and still can't) on the index page.
And I think that's where the error is. The source forum has been merged correctly but all subforums have disappeared, though everything is in the database.
Any idea what I should do to solve the problem?

Thanks.

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

Re: Merge two phpbb3 forums

Post by alargeau » Tue Dec 14, 2010 6:53 pm

Hello again,

Well, finally, I understood the error. All subforums had a different id. So I corrected that manually and now I can see the subforums correctly. But (there's always but, right?) I can't see posts in them. And I think that's for the same reason, I assume those posts don't have the same id as the subforum they're supposed to be in. With the subforums, no problem to do it manually but with the posts, it's definitely another thing because there are over 50,000 posts.
Any idea on what I should do now?

Thanks.

Edit: I had a better look at my database and all the posts have the good id. So I don't know why I can't read subforums posts... Still digging.

Locked

Return to “[3.0.x] Convertors”

cron