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

Reply
 
Thread Tools Display Modes
  #1  
Old 03-31-2008, 12:34 AM
k007 k007 is offline
 
Join Date: Jan 2008
Posts: 26
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default 2 vbulletin dbs bridge?

is there a script/hack out there that bridges two vbulletin databases? i dont want to merge them, i just want to be able to use both of them at the same time.
Reply With Quote
  #2  
Old 03-31-2008, 04:35 AM
Dismounted's Avatar
Dismounted Dismounted is offline
 
Join Date: Jun 2005
Location: Melbourne, Australia
Posts: 15,047
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

There may well be, but none that I know of.
Reply With Quote
  #3  
Old 04-01-2008, 07:28 AM
Adrian Schneider's Avatar
Adrian Schneider Adrian Schneider is offline
 
Join Date: Jul 2004
Posts: 2,528
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I've created one but the complexity of it is nearly overkill for just synchronizing users.

A simple option (passed my basic proof of concept test) would be using MySQL's new view functionality instead. Absolutely backup first.

For every shared table (user, usergroup, userfield, access, etc.) you would need to drop the original table, and then recreate it as a view:

Code:
CREATE VIEW user as
     SELECT * FROM source_db.user;
MySQL properly optimizes away the view since it's a simple view.

So, automatically, when vBulletin performs queries on any of these "view" tables, MySQL will simply replace the database/table names so it directly touches the other database.

Pros
  • Easy to maintain
  • Should be very fast
Cons
  • Limited to same physical server
  • More risk (6 sites dependent on one)
  • Not stress tested -- Possible complications... ?
Reply With Quote
  #4  
Old 04-01-2008, 08:02 AM
Dismounted's Avatar
Dismounted Dismounted is offline
 
Join Date: Jun 2005
Location: Melbourne, Australia
Posts: 15,047
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

So basically a symbolic link to another database? That's cool, when was it introduced into MySQL, Adrian? I'm afraid I don't really keep up with MySQL .
Reply With Quote
  #5  
Old 04-01-2008, 08:05 AM
Adrian Schneider's Avatar
Adrian Schneider Adrian Schneider is offline
 
Join Date: Jul 2004
Posts: 2,528
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Not really new... but new enough for most people not to have it. 5.01, according to the docs.

This isn't really what they were meant for, but hey it works. :up:
Reply With Quote
  #6  
Old 07-19-2009, 02:06 AM
Wilfred1 Wilfred1 is offline
 
Join Date: Jul 2009
Posts: 99
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by SirAdrian View Post
I've created one but the complexity of it is nearly overkill for just synchronizing users.

A simple option (passed my basic proof of concept test) would be using MySQL's new view functionality instead. Absolutely backup first.

For every shared table (user, usergroup, userfield, access, etc.) you would need to drop the original table, and then recreate it as a view:

Code:
CREATE VIEW user as
     SELECT * FROM source_db.user;
MySQL properly optimizes away the view since it's a simple view.

So, automatically, when vBulletin performs queries on any of these "view" tables, MySQL will simply replace the database/table names so it directly touches the other database.

Pros
  • Easy to maintain
  • Should be very fast
Cons
  • Limited to same physical server
  • More risk (6 sites dependent on one)
  • Not stress tested -- Possible complications... ?
I know this is a bit old but how did the views option go?

I would very much like to test this so any idea what the source_db syntax would be for the user table located in a separate db on the same server?
Reply With Quote
  #7  
Old 07-19-2009, 03:08 AM
Adrian Schneider's Avatar
Adrian Schneider Adrian Schneider is offline
 
Join Date: Jul 2004
Posts: 2,528
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I've only tested it in a development environment... never on a production site.

"source_db" is the name of the other database that you want to pull the users from.
Reply With Quote
  #8  
Old 07-19-2009, 03:16 AM
Wilfred1 Wilfred1 is offline
 
Join Date: Jul 2009
Posts: 99
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks Sir Adrian but wouldn't need some form of connection string not just the name but username and password as well?
Reply With Quote
  #9  
Old 07-19-2009, 04:02 AM
Dismounted's Avatar
Dismounted Dismounted is offline
 
Join Date: Jun 2005
Location: Melbourne, Australia
Posts: 15,047
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

No, the database user that you access the DB with just needs to have permissions to the other DB.
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 07:18 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04023 seconds
  • Memory Usage 2,246KB
  • 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
  • (2)bbcode_code
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (9)post_thanks_box
  • (9)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (9)post_thanks_postbit_info
  • (9)postbit
  • (9)postbit_onlinestatus
  • (9)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