Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 General Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 03-10-2006, 05:42 PM
007's Avatar
007 007 is offline
 
Join Date: Jan 2003
Location: United States
Posts: 872
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Merging multiple forums? Anybody have experience with this?

Does the IMPEX importer work to merge multiple vBulletin sites into one database?

I'm talking about merging everything. Obviously lots of individual ID's for different things would need to be changed, i.e. posts, threads, users, everything, in order not to collide with eachother.

Has anybody else done this before?
Reply With Quote
  #2  
Old 03-10-2006, 06:52 PM
SkyCatcher's Avatar
SkyCatcher SkyCatcher is offline
 
Join Date: Feb 2003
Location: Germany
Posts: 310
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I don't think that ImpEx will work without a little thinking.

Here's why:

When you run impex it takes posts threads userID's etc.. from the database you've provided in the impex config. Lets call this database vb_A.

So lets say you have vb_A, vb_B, and vbC.

vb_A = Old VB forum
vb_B = 2nd old VB forum
vb_C = New VB installation DB

ImpEx will take everything from vb_A and import it into vb_C.

if you change the config to use vb_B and run ImpEx it will first clear the DB tables and then run so you will lose all info previously imported from vb_A...

SO

What you'd have to do is this:

set impex config to import from vb_A to vb_C

then copy vb_C to a new DB such as vb_importedA

now clear the DB vb_C just incase

change impex config to import vb_B to vb_C

run impex and let it import again

copy vb_C to vb_importedB

You now have 2 databases, vb_importedA and vb_importedB which will work with your new VB version.

The problem is that userID's, groups, threads, etc... will have their own ID numbers since ImpEx starts at 0 and increments.

So lets keep vb_importedA and vb_importedB as a backup incase anything goes wrong and work with vb_C.

clear it and import whichever DB is more important to you, as far as groups, admins etc go.

This is the part I'm not 100% sure about and may need help, but you'll need to work with the other DB and change userID's.

So lets say we reimport vb_A to vb_C - now the old forum with vb_A will work with the new vbulletin forum so we need to fix the other old forum to work.

So make a new DB and call it vb_editB

Copy vb_importedB to vb_editB

Overview:

We now have

vb_A = old forum1
vb_B = old forum2
vb_C = DB that the new forum will use
vb_importedA = impex imported version of forum1
vb_importedB = impex imported version of forum2
vb_editB = the test imported version of forum2 which we can safely mess with

First thing you will need to do is seperate UserID's, threadID's and postID's from the imported A forum1 values.

So lets increment everything by 1,000 (larger if you have a huge forum) to set a gap between the forum1 and 2 ID's

so if UserID=1 for forum1, UserID for forum2 will start at 1001

//Select database vb_editB and run
Code:
UPDATE user SET user.userid = (user.userid + 1000)
//Set threadID's higher
Code:
UPDATE thread SET thread.threadid = (thread.threadid + 100000)
//Set postID's for threads to match the new userID's
Code:
UPDATE thread SET thread.postuserid = (thread.postuserid +1000)
//Update posts to match threadID, UserID and add 500000 to postID
Code:
UPDATE post SET post.threadid = (post.threadid + 100000)
UPDATE post SET post.postid = (post.postid + 500000)
UPDATE post SET post.userid = (post.userid + 1000)
//Change values for last threadID to match new threadID
Code:
UPDATE forum SET forum.lastthreadid = (forum.lastthreadid + 100000)

Now you should be able to export tables: forum, user, post, and thread and then reimport them into vb_C (make sure not to add the drop table if exist!)

and it "should" work.

I just came up with this so please take caution and MAKE BACKUPS of everything please. I don't want to be responsible for any mistakes.

Also, I incremented userID's by 1000, ThreadID's by 100,000 and PostID's by 500,000

You want to create a sufficient "gap" between forum1 and 2 so increase these numbers if you think they will overlap.

As for hacks and mods that you want to carry over, pay attention to the ImportuserID that impex used to make comparisons.

Like importing the arcade hack (example):
This will compare the importeduserID's (which match the current arcade userID's and if they match it updates the arcade userID to match the current userID

Code:
UPDATE arcade_users, user SET arcade_users.userid = user.userid WHERE arcade_users.userid = user.importuserid;
and to do the same with forum2 (vb_editB)
Code:
UPDATE arcade_users, user SET arcade_users.userid = (user.userid +1000) WHERE arcade_users.userid = user.importuserid;
I hope this helps or at least gives you an idea of what I mean.

I am not an expert at this, I just like to tinker
Reply With Quote
  #3  
Old 03-10-2006, 07:27 PM
007's Avatar
007 007 is offline
 
Join Date: Jan 2003
Location: United States
Posts: 872
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Wow, thanks for the really detailed reply. I will definitely do all of this in a test area to make sure it works. As for the arcade, it's probably easier just to delete all scores and start over.

As for the userid problems, I can use the user merge function that is built standard into vB. :-)
Reply With Quote
  #4  
Old 03-11-2006, 07:29 AM
Marco van Herwaarden Marco van Herwaarden is offline
 
Join Date: Jul 2004
Posts: 25,415
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Sorry to disappoint you, but ImpEx is designed to do also this task, will not need anything as described in post #2.

Yes you can merge 2 forums with ImpEx (A->C + B->C or just B->A) without any manual tweaking at all. Just make sure to finalize the first import (in a A->C + B->C situation) before starting the second import.

See the ImpEx online documentation and/or read in the Import System forum at vb.com.

PS Doing some testruns on a testboard first is always a good idea.

PSS Moving this to General vB discussions
Reply With Quote
  #5  
Old 03-11-2006, 10:38 PM
SkyCatcher's Avatar
SkyCatcher SkyCatcher is offline
 
Join Date: Feb 2003
Location: Germany
Posts: 310
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Not disappointing at all, I love the ImpEx script!

So you can import forumA and B into C by resetting the importuserID columns to 0 and then starting the next import?

I was sure that it drops data from existing tables during the import
Reply With Quote
  #6  
Old 09-29-2006, 02:04 AM
LostOne LostOne is offline
 
Join Date: Aug 2006
Posts: 9
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

well, I am trying to do this and did a good job with the first import but I am about clueless as to what to change in the config file for the second import.

It all seems to point to data on my server but how to I make it point to that particular forum to extract the file is still a mystery for me.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 11:08 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.05657 seconds
  • Memory Usage 2,216KB
  • Queries Executed 13 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (7)bbcode_code
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (6)post_thanks_box
  • (6)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (6)post_thanks_postbit_info
  • (6)postbit
  • (6)postbit_onlinestatus
  • (6)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete