phpbb3 user information over multiple Database/Domains

Discussion of general topics related to the new version and its place in the world. Don't discuss new features, report bugs, ask for support, et cetera. Don't use this to spam for other boards or attack those boards!
Forum rules
Discussion of general topics related to the new release and its place in the world. Don't discuss new features, report bugs, ask for support, et cetera. Don't use this to spam for other boards or attack those boards!
Post Reply
MKruer
Registered User
Posts: 156
Joined: Sun Jul 20, 2003 9:01 pm

phpbb3 user information over multiple Database/Domains

Post by MKruer »

Sorry about posting here, I could not find this information anywhere in the FAQ, feature list, and the search function appears not to have the data either.

Can/will phpbb3 user DB be able to be spread over multiple domains but keep the user information synchronized?

Currently I am running a phpbb forum, and in the future would like to break the forum apart into two different sites. However I would like have it so once one person creates an account on one of the forums, it will automatically update the user information in the other forum.

Hope that makes sense.

User avatar
VxJasonxV
Registered User
Posts: 341
Joined: Sun Mar 02, 2003 2:51 pm
Location: Castle Rock, CO
Contact:

Re: phpbb3 user information over multiple Database/Domains

Post by VxJasonxV »

1) In the exact manner you described, no I don't think that will be present "out of the box".
2) phpBB3 DOES support custom (user-created) authentication methods. So if you can hack something together, you might be able to find an easy way to accomplish your goal.
"If You Support It, They Will Come."
"Construction"

code reader
Registered User
Posts: 653
Joined: Wed Sep 21, 2005 3:01 pm

Re: phpbb3 user information over multiple Database/Domains

Post by code reader »

MKruer wrote: Sorry about posting here, I could not find this information anywhere in the FAQ, feature list, and the search function appears not to have the data either.

Can/will phpbb3 user DB be able to be spread over multiple domains but keep the user information synchronized?

Currently I am running a phpbb forum, and in the future would like to break the forum apart into two different sites. However I would like have it so once one person creates an account on one of the forums, it will automatically update the user information in the other forum.

Hope that makes sense.
actually, ttbomk, this is very much possible, although not without some poking in the code.
the key is to keep the 2 forums in one databas, using 2 sets of tables (by means of a different table name prefix), and keep a single users table. (maybe some other shared tables, such as PM, sessions and maybe some others)
some little stuff may get a bit confused, such as post counts, but the main features work fine.
i know for a fact that people are doing it with phpbb 2.
i cant tell you how much more work (if any) will be required to make it work for v3.

MKruer
Registered User
Posts: 156
Joined: Sun Jul 20, 2003 9:01 pm

Re: phpbb3 user information over multiple Database/Domains

Post by MKruer »

code reader wrote:
MKruer wrote: Sorry about posting here, I could not find this information anywhere in the FAQ, feature list, and the search function appears not to have the data either.

Can/will phpbb3 user DB be able to be spread over multiple domains but keep the user information synchronized?

Currently I am running a phpbb forum, and in the future would like to break the forum apart into two different sites. However I would like have it so once one person creates an account on one of the forums, it will automatically update the user information in the other forum.

Hope that makes sense.
actually, ttbomk, this is very much possible, although not without some poking in the code.
the key is to keep the 2 forums in one databas, using 2 sets of tables (by means of a different table name prefix), and keep a single users table. (maybe some other shared tables, such as PM, sessions and maybe some others)
some little stuff may get a bit confused, such as post counts, but the main features work fine.
i know for a fact that people are doing it with phpbb 2.
i cant tell you how much more work (if any) will be required to make it work for v3.
I think you have that backwards, I want the DB split, but to share the same user names, I haven’t poked around v3 too much, but if its like v2 for the most part, there would need to be an additional kick script that pushes the data between the two domains hence databases.

If this hasn’t really be discussed in full yet, then perhaps it might warrant additional discussion. This could be also used to create a live backup site on a different server. So of one of the DB goes down, it automatically differs to the other. The monumental task is making sure that the data does not become out of sync during a period of heavy latency or in the rare case of two message being posted at the same time.

code reader
Registered User
Posts: 653
Joined: Wed Sep 21, 2005 3:01 pm

Re: phpbb3 user information over multiple Database/Domains

Post by code reader »

MKruer wrote: I think you have that backwards, I want the DB split, but to share the same user names, I haven’t poked around v3 too much, but if its like v2 for the most part, there would need to be an additional kick script that pushes the data between the two domains hence databases.
i dont think i have it backwards.
what you have to understand is a delicate point:
in phpbb, different domains can share the same database, without sharing any of the data.
this is done by the use of "table prefix". basically, although it is the same database, because the two (or more) boards use completely separate sets of tables, the effect is the same of using two completely separate databases, or what you dubbed "split db".

the "trick" i pointed to kicks in at this point: you use almost completely spararate sets of tables, but not quite.
you share one (or maybe several) table(s) among the boars/domains, namly the users table. (and, btw, doing it this way one can share the same user base among more than just 2 boards/domains)

achieveing the same effect with separate databases requires orders of magnitude more changes to the code if one wants a truely shared users base, due to the way sql queries are peppered across the source files, and the fact that many queries use the users table in conjunction with other table(s) in the same query.
at the same time, it is easy to achieve using the way i described (i didnt invent it. as i stated earlier, quite a few people are doing exactly this with phpbb2), with very few changes to the code.

the alternative you outline, which is to keep the two sets of data completely separate, and use some (presumably external) process to merge the users table (continously or periodically) is doable, but it will be quite cumbersome, and you will have to pay very close attention not to overwrite fresh registrations on either side. imho, it is greatly inferior to the much simpler way i described.

my late uncle used to say: "a man with two watches never knows what time it is".
what it means is, keeping two sets of data which are supposed to be identical is a bad practice. one should keep only one copy of the data, and access it from both points.

to summarise:
i think your make an assumption "two domains hence databases", which is just not true: two domains do not require two databases, only two sets of tables, which, in phpbb, is not the same thing.

MKruer
Registered User
Posts: 156
Joined: Sun Jul 20, 2003 9:01 pm

Re: phpbb3 user information over multiple Database/Domains

Post by MKruer »

Oh ok, I see. I was asking to split the forums into 2 different domains that each have their own DB, but still share the user data.

tiger2kn5
Registered User
Posts: 49
Joined: Tue Jul 10, 2001 2:59 am
Location: US of A

Re: phpbb3 user information over multiple Database/Domains

Post by tiger2kn5 »

pretty simple actually

Install each forum on its own domain, using the same database, just make sure that during the installation you set different table prefix "forum1_" and "forum2_".

then go to one of the domains ftp and open up constants.php and go down the the constant for the user table. take out the $table_prefix and put "forum1_".

you can do go into phpmyadmin or whatever your using and drop forum2_users since you will only be utilising forum1_users. and that should do the trick 8)

if you want to share the user preferences and private messages (so they can check their private messages from either domains then you would have to change the table prefix to those tables as well. but for a simple userbase sharing this is good.
Image

Yawnster
Registered User
Posts: 342
Joined: Sat Jan 29, 2005 9:18 pm
Location: London, UK
Contact:

Re: phpbb3 user information over multiple Database/Domains

Post by Yawnster »

http://www.phpbb.com/kb/article.php?article_id=55" target="_blank

This KB article outlines the procedure.. you will also have to modify the new Sessions_keys Table as well.. the article needs to be updated..

Yawnster

MKruer
Registered User
Posts: 156
Joined: Sun Jul 20, 2003 9:01 pm

Re: phpbb3 user information over multiple Database/Domains

Post by MKruer »

@ Yawnster

Thanks for the FYI. I Just hope they make it a standard option in phpBB v3. I hate hacking code. I realy, realy do :mrgreen:

User avatar
VxJasonxV
Registered User
Posts: 341
Joined: Sun Mar 02, 2003 2:51 pm
Location: Castle Rock, CO
Contact:

Re: phpbb3 user information over multiple Database/Domains

Post by VxJasonxV »

MKruer wrote: @ Yawnster

Thanks for the FYI. I Just hope they make it a standard option in phpBB v3. I hate hacking code. I realy, realy do :mrgreen:
I don't mean to be negative, however...
Don't get your hopes up.
Multi forum user sharing isn't exactly "in demand" and the team has no reason to add it into the core code.
Will they? Maybe.
Is it already? No.

I highly highly highly suggest checking out the custom authentication I mentioned, though.
"If You Support It, They Will Come."
"Construction"

Post Reply