[TIP] How to Merge one SMF Forum with Another using MySQL

Started by jkdove, August 25, 2009, 03:28:17 PM

Previous topic - Next topic

Herman's Mixen

#20
diggin into my hard drives ;)

found this tiny old scripty wich was written by Oldiesmann for SMF 1.0.x rewritten by Resourzes for 1.1.x
for 2.0.x it needs a bit of tweaking but its useable ;)

Read the discriptions inside that file !!
Met vriendelijke groet, The Burglar!

 House Mixes | Mixcloud | Any Intelligent fool can make things bigger, more complex, and more violent.
It takes a touch of genius - and a lot of courage - to move in the opposite direction. - Albert Einstein

Former Godfather of our dutch community ;)

OnThePike

Thank you for the reply, but unfortunately, I'm not experienced enough in PHP to know exactly what should be tweaked, and where. I ran the script as-is, uncommented the member update steps, but the script failed nonetheless. Here's the list of errors. perhaps you, or someone else can further assist?

[Thu Sep 20 00:19:10 2012] [error] [client 127.0.0.1] PHP Warning:  mysql_result() expects parameter 1 to be resource, boolean given in I:\\wamp\\www\\convert\\mergeSMF.php on line 69, referer: http://localhost/convert/mergeSMF.php
[Thu Sep 20 00:19:10 2012] [error] [client 127.0.0.1] PHP Warning:  mysql_free_result() expects parameter 1 to be resource, boolean given in I:\\wamp\\www\\convert\\mergeSMF.php on line 70, referer: http://localhost/convert/mergeSMF.php
[Thu Sep 20 00:19:10 2012] [error] [client 127.0.0.1] PHP Warning:  mysql_result() expects parameter 1 to be resource, boolean given in I:\\wamp\\www\\convert\\mergeSMF.php on line 90, referer: http://localhost/convert/mergeSMF.php
[Thu Sep 20 00:19:10 2012] [error] [client 127.0.0.1] PHP Warning:  mysql_free_result() expects parameter 1 to be resource, boolean given in I:\\wamp\\www\\convert\\mergeSMF.php on line 91, referer: http://localhost/convert/mergeSMF.php
[Thu Sep 20 00:19:14 2012] [error] [client 127.0.0.1] PHP Warning:  mysql_result() expects parameter 1 to be resource, boolean given in I:\\wamp\\www\\convert\\mergeSMF.php on line 112, referer: http://localhost/convert/mergeSMF.php
[Thu Sep 20 00:19:14 2012] [error] [client 127.0.0.1] PHP Warning:  mysql_free_result() expects parameter 1 to be resource, boolean given in I:\\wamp\\www\\convert\\mergeSMF.php on line 113, referer: http://localhost/convert/mergeSMF.php
[Thu Sep 20 00:19:35 2012] [error] [client 127.0.0.1] PHP Warning:  mysql_result() expects parameter 1 to be resource, boolean given in I:\\wamp\\www\\convert\\mergeSMF.php on line 136, referer: http://localhost/convert/mergeSMF.php?step=2
[Thu Sep 20 00:19:35 2012] [error] [client 127.0.0.1] PHP Warning:  mysql_free_result() expects parameter 1 to be resource, boolean given in I:\\wamp\\www\\convert\\mergeSMF.php on line 137, referer: http://localhost/convert/mergeSMF.php?step=2
[Thu Sep 20 00:19:42 2012] [error] [client 127.0.0.1] PHP Warning:  mysql_result() expects parameter 1 to be resource, boolean given in I:\\wamp\\www\\convert\\mergeSMF.php on line 166, referer: http://localhost/convert/mergeSMF.php?step=3
[Thu Sep 20 00:19:42 2012] [error] [client 127.0.0.1] PHP Warning:  mysql_free_result() expects parameter 1 to be resource, boolean given in I:\\wamp\\www\\convert\\mergeSMF.php on line 167, referer: http://localhost/convert/mergeSMF.php?step=3
[Thu Sep 20 00:19:42 2012] [error] [client 127.0.0.1] PHP Warning:  mysql_fetch_assoc() expects parameter 1 to be resource, boolean given in I:\\wamp\\www\\convert\\mergeSMF.php on line 170, referer: http://localhost/convert/mergeSMF.php?step=3
[Thu Sep 20 00:19:42 2012] [error] [client 127.0.0.1] PHP Warning:  mysql_free_result() expects parameter 1 to be resource, boolean given in I:\\wamp\\www\\convert\\mergeSMF.php on line 192, referer: http://localhost/convert/mergeSMF.php?step=3
[Thu Sep 20 00:19:49 2012] [error] [client 127.0.0.1] PHP Warning:  mysql_result() expects parameter 1 to be resource, boolean given in I:\\wamp\\www\\convert\\mergeSMF.php on line 266, referer: http://localhost/convert/mergeSMF.php?step=4
[Thu Sep 20 00:19:49 2012] [error] [client 127.0.0.1] PHP Warning:  mysql_free_result() expects parameter 1 to be resource, boolean given in I:\\wamp\\www\\convert\\mergeSMF.php on line 267, referer: http://localhost/convert/mergeSMF.php?step=4
[Thu Sep 20 00:19:49 2012] [error] [client 127.0.0.1] PHP Warning:  mysql_result() expects parameter 1 to be resource, boolean given in I:\\wamp\\www\\convert\\mergeSMF.php on line 285, referer: http://localhost/convert/mergeSMF.php?step=4
[Thu Sep 20 00:19:49 2012] [error] [client 127.0.0.1] PHP Warning:  mysql_free_result() expects parameter 1 to be resource, boolean given in I:\\wamp\\www\\convert\\mergeSMF.php on line 286, referer: http://localhost/convert/mergeSMF.php?step=4
[Thu Sep 20 00:19:52 2012] [error] [client 127.0.0.1] PHP Warning:  mysql_result() expects parameter 1 to be resource, boolean given in I:\\wamp\\www\\convert\\mergeSMF.php on line 308, referer: http://localhost/convert/mergeSMF.php?step=7
[Thu Sep 20 00:19:52 2012] [error] [client 127.0.0.1] PHP Warning:  mysql_free_result() expects parameter 1 to be resource, boolean given in I:\\wamp\\www\\convert\\mergeSMF.php on line 309, referer: http://localhost/convert/mergeSMF.php?step=7
[Thu Sep 20 00:19:57 2012] [error] [client 127.0.0.1] PHP Warning:  mysql_fetch_row() expects parameter 1 to be resource, boolean given in I:\\wamp\\www\\convert\\mergeSMF.php on line 332, referer: http://localhost/convert/mergeSMF.php?step=8
[Thu Sep 20 00:19:57 2012] [error] [client 127.0.0.1] PHP Warning:  mysql_free_result() expects parameter 1 to be resource, boolean given in I:\\wamp\\www\\convert\\mergeSMF.php on line 337, referer: http://localhost/convert/mergeSMF.php?step=8
[Thu Sep 20 00:29:46 2012] [error] [client 127.0.0.1] PHP Warning:  mysql_fetch_assoc() expects parameter 1 to be resource, boolean given in I:\\wamp\\www\\convert\\mergeSMF.php on line 170, referer: http://localhost/convert/mergeSMF.php?step=3
[Thu Sep 20 00:29:46 2012] [error] [client 127.0.0.1] PHP Warning:  mysql_free_result() expects parameter 1 to be resource, boolean given in I:\\wamp\\www\\convert\\mergeSMF.php on line 192, referer: http://localhost/convert/mergeSMF.php?step=3
[Thu Sep 20 00:30:10 2012] [error] [client 127.0.0.1] File does not exist: I:/wamp/www/gallery, referer: http://localhost/forum/index.php
[Thu Sep 20 00:30:41 2012] [error] [client 127.0.0.1] File does not exist: I:/wamp/www/gallery, referer: http://localhost/forum/index.php
[Thu Sep 20 00:36:17 2012] [error] [client 127.0.0.1] File does not exist: I:/wamp/www/gallery, referer: http://localhost/forum/index.php
[Thu Sep 20 00:37:46 2012] [error] [client 127.0.0.1] PHP Warning:  mysql_fetch_assoc() expects parameter 1 to be resource, boolean given in I:\\wamp\\www\\convert\\mergeSMF.php on line 170, referer: http://localhost/convert/mergeSMF.php?step=3
[Thu Sep 20 00:37:46 2012] [error] [client 127.0.0.1] PHP Warning:  mysql_free_result() expects parameter 1 to be resource, boolean given in I:\\wamp\\www\\convert\\mergeSMF.php on line 192, referer: http://localhost/convert/mergeSMF.php?step=3
[Thu Sep 20 00:38:20 2012] [error] [client 127.0.0.1] File does not exist: I:/wamp/www/gallery, referer: http://localhost/forum/index.php
[Thu Sep 20 00:43:45 2012] [error] [client 127.0.0.1] PHP Warning:  mysql_fetch_assoc() expects parameter 1 to be resource, boolean given in I:\\wamp\\www\\convert\\mergeSMF.php on line 170, referer: http://localhost/convert/mergeSMF.php?step=3
[Thu Sep 20 00:43:45 2012] [error] [client 127.0.0.1] PHP Warning:  mysql_free_result() expects parameter 1 to be resource, boolean given in I:\\wamp\\www\\convert\\mergeSMF.php on line 192, referer: http://localhost/convert/mergeSMF.php?step=3
[Thu Sep 20 00:43:51 2012] [error] [client 127.0.0.1] PHP Fatal error:  Call to undefined function db_query() in I:\\wamp\\www\\convert\\mergeSMF.php on line 215, referer: http://localhost/convert/mergeSMF.php?step=4
[Thu Sep 20 00:44:30 2012] [error] [client 127.0.0.1] PHP Fatal error:  Call to undefined function db_query() in I:\\wamp\\www\\convert\\mergeSMF.php on line 215

Herman's Mixen

This script goes into the secondary forum root where the Settings.php and SSI.php are in the root of that forum, the primary forum will be the merged forums...

Also wich version of SMF you would merge i.e : 1.0.x, 1.1,x or SMF 2.x only for SMF 2.x it needs to tweaked to work with SMF 2.x installations...


define('PRIMARY_DB_PREFIX', 'smf_');


change smf_ to your prefix which is used on the DB of the primary forum

then you can run it as hxxp://www.domain.tld/forum/mergeSMF.php from the secondary SMF installation
Met vriendelijke groet, The Burglar!

 House Mixes | Mixcloud | Any Intelligent fool can make things bigger, more complex, and more violent.
It takes a touch of genius - and a lot of courage - to move in the opposite direction. - Albert Einstein

Former Godfather of our dutch community ;)

Deaks

The Burglar, you need to get permission from Oldies to post that sorry
~~~~
Former SMF Project Manager
Former SMF Customizer

"For as lang as hunner o us is in life, in nae wey
will we thole the Soothron tae owergang us. In truth it isna for glory, or wealth, or
honours that we fecht, but for freedom alane, that nae honest cheil gies up but wi life
itsel."

Herman's Mixen

Oops didn't know that thought it was a community wide tool back in the days... anyway thx for the info bryan
Met vriendelijke groet, The Burglar!

 House Mixes | Mixcloud | Any Intelligent fool can make things bigger, more complex, and more violent.
It takes a touch of genius - and a lot of courage - to move in the opposite direction. - Albert Einstein

Former Godfather of our dutch community ;)

OnThePike

Here's some detailed background:

I am currently trying to merge two SMF 2.0.2 forums.

The older, original board began as phpBB 2.0.4, updated to 2.0.11, then upgraded to phpBB 3.0.10. From there, it was converted to SMF 2.0.2 and resides in the path /home/local/public_html/convert/.

My current (primary) forum began as SMF 1.0.4, was updated to 1.1.16, then upgraded to 2.0.2. This forum resides in /home/local/public_html/forum/.

Via localhost, both boards share the same database (for merging purposes). The "convert" table prefix is phpbbsmf_ while the "forum" table prefix is smf_.

The merge script you posted (but has since been removed) was placed in, and executed from /convert/ which is the secondary forum. However, let me reiterate: I had already successfully merged these two forums into one primary SMF forum, however the result was unsatisfactory because the old topic ID numbers were more recent than the current forum topic ID's which placed the ancient topics above the current topics as "most recent". I could solve this issue if there was a way to default topic display to topic_date instead of topic_id, but to my knowledge, this isn't possible. Finally, none of the available topic display mods allow or offer a date function.

Each board has roughly 500 members. About half are duplicate members, half different between each. I was able to merge existing members into a single user account for each of those duplicates retaining all relevant data (posts, topics, private messages, etc). My problem and issue isn't the ability to merge -- it's the inability to display topics in date order. And that's the help I seek.

At this time, I have reverted both boards back to their independent SMF 2.0.2 state. I was thinking of attempting the merge from what is now primary to secondary, instead of the other way around. This would (should) retain proper topic_id display, but might cause other issues I haven't yet realized. So before I go that route, I'm here looking for a better method.

Assistance toward that end, in addition to the merge script 2.0.2 compatibility changes would be greatly appreciated :-)

OnThePike

Quote from: Poύνικ on September 20, 2012, 04:36:12 AM
The Burglar, you need to get permission from Oldies to post that sorry

Why? That script is publicly available by the author here:

hxxp:resourcez.donationspro.com/index.php?action=tpmod;dl=item7 [nonactive]

bfeist

Quote from: The Burglar! on September 19, 2012, 06:17:58 PM
diggin into my hard drives ;)

found this tiny old scripty wich was written by Oldiesmann for SMF 1.0.x rewritten by Resourzes for 1.1.x
for 2.0.x it needs a bit of tweaking but its useable ;)

Read the discriptions inside that file !!

Hi there. Can you give us any hints on what changes you had to make to make the script compatible with 2.0.x? Any help would be greatly appreciated.

bfeist


Gwenwyfar

#29
Old post but: I ran this for boards + categories only, so that I could merge an scraped database into an existing smf install with categories/structure all set and organize it from there, and it worked just fine, but I don't see sub-sections anywhere. Is this something separate or this wasn't supposed to happen?

Well, if I find a solution to this I'll post it here later.

Edit: They were there and the topics were inside them, but they got lost in not knowing which section they belonged to. I ran a fix errors and all of them showed up on salvaged section, so they just need to be moved to their places later :)

Very nice tip, thanks for posting this! Will be very useful later for me, I'll be merging 3 forums together. Glad to see it works well.
"It is impossible to communicate with one that does not wish to communicate"

Gwenwyfar

#30
Doing the merge with the other 2 forums now, figured out the problem about child boards, its missing the id_parent for the boards.

So it would be UPDATE smf_boards SET ID_PARENT = ID_PARENT+91;
With the same number as the boards.
"It is impossible to communicate with one that does not wish to communicate"

Advertisement: