Accessing the same data from two different installations

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
User avatar
Eelke
Registered User
Posts: 606
Joined: Thu Dec 20, 2001 8:00 am
Location: Bussum, NL
Contact:

Accessing the same data from two different installations

Post by Eelke »

Just something to ponder, no support request or anything, if this is not allowed, my apologies.

Just a hypothetical question. Would it be possible to have two different copies of 3.0 in different locations accessing the same forum data? The reason I started wondering about this is that some time in the future, I will probably have a live 3.0 board, and a newly developed version of my website, that will reside in a demo location for some time. Would be nice if the forum of the demo would just access the live data. I think that'd be a problem with 2.0.x, but IIRC in 3.0, any script location information is generated dynamically from the actual locations in stead of being statically configured in the database.

Any thoughts?

[Edit: typos]
Last edited by Eelke on Thu Aug 24, 2006 11:52 am, edited 1 time in total.

profpete
Registered User
Posts: 140
Joined: Wed Dec 08, 2004 10:49 pm
Location: Wales, UK

Re: Accessing the same data from two different installations

Post by profpete »

As long as all the database queries remain identical, i.e. there's no code changes etc, I can't see where there would be a problem.

I already have it running quite happily on http//localhost:80/ but its quite happy being forwarded from my no-ip.com domain on a different port too! Not quite two installations, but the lookup problem would be the same...

moondream
Registered User
Posts: 33
Joined: Tue Aug 19, 2003 1:27 pm

Re: Accessing the same data from two different installations

Post by moondream »

If you plan to run Olympus and phpBB2 with the same database, this cannot work. The database schema is very different. Running two installations of Olympus should work (with some glitches where the database changed) - you could do some tests with a shadow instalation before upgrading the live forum.

If you want to have real phpBB2 data in you Olympus test forum, one way would be to convert it every night by a cron job. Of course any changed in the test forum would be lost every morning.

This is more or less what I'm doing at the moment. (although I only sync manually). The mods and some other testers are already testing it to evaluate a live usage in the future.

There is no official converter script yet, so it would be a good php/mysql lesson for you to write one :)

User avatar
Eelke
Registered User
Posts: 606
Joined: Thu Dec 20, 2001 8:00 am
Location: Bussum, NL
Contact:

Re: Accessing the same data from two different installations

Post by Eelke »

Er, no, not 2.0 and 3.0.
Eelke wrote: Would it be possible to have two different copies of 3.0 in different locations.

I'm talking of a hypothetical situation in the future, where 3.0 is released and I have already converted my existing 2.0 board with the official converter, which will be released by then. So, 2.0 is ancient history by then ;) I would also be working on on a new version of the site (along with a brand new template for the forums), that also uses phpBB 3.0 as its forum solution and that I have installed on the same server as the live site, but obviously in a different location, such as http://www.myhost.com/demo." target="_blank So, exact same database schema.

With 2.0, this would not work, because the script path is configured in the database, and links get generated using it. You'd end up in the "main" installation within a few clicks. With 3.0, I don't think this is the case (as described in my original post).

Profpete: I think you're right, that's kind of the same. Only thing is that I think you wouldn't really notice in case you were diverted to your "main" location. Does the URL remain the same during a session depending on the entry point you choose?

User avatar
VinDuv
Registered User
Posts: 73
Joined: Wed May 03, 2006 8:10 pm
Location: France
Contact:

Re: Accessing the same data from two different installations

Post by VinDuv »

You want to have two installations (in two directories) of phpBB3 using the same database ? You'll have problems with file uploads and avatars directories... (unless you can create links of files/ and images/avatars/uploads from one install to the other).

User avatar
Eelke
Registered User
Posts: 606
Joined: Thu Dec 20, 2001 8:00 am
Location: Bussum, NL
Contact:

Re: Accessing the same data from two different installations

Post by Eelke »

OK, good point. That's the kind of input I was looking for :) I may be able to figure out how to redirect such directories on my host.

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

Re: Accessing the same data from two different installations

Post by code reader »

you might have problems with several variables in the config table:
servers_name
smilies_path
upload_icons_path
upload_path
avatar_gallery_path
avatar_path
cookie_domain // some browser setting can cause it to refuse cookies whose domain differs from the server

one of the ways of solving it is to edit common.php, and after the config table is read, force (hardcoded) values in the $config array, overwriting the values read from the db.
i am not sure, but it is possible that leaving cookie_domain empty will make it work with different domains.

moondream
Registered User
Posts: 33
Joined: Tue Aug 19, 2003 1:27 pm

Re: Accessing the same data from two different installations

Post by moondream »

the config values code reader mentioned should be no problem as the paths are relative to the phpBB root and server name and cookie_domain should be the same if you install the test installation on the same system.

If you cannot share all variable directories some thing will be broken in the test installation (avatars will not be displayed etc.) and if you cannot share the cache directory it could lead to some incoherencies if you cannot disable the cache entirely.

User avatar
Highway of Life
Registered User
Posts: 1399
Joined: Tue Feb 08, 2005 10:18 pm
Location: I'd love to change the World, but they won't give me the Source Code
Contact:

Re: Accessing the same data from two different installations

Post by Highway of Life »

VinDuv wrote: You want to have two installations (in two directories) of phpBB3 using the same database ? You'll have problems with file uploads and avatars directories... (unless you can create links of files/ and images/avatars/uploads from one install to the other).

I was going to say this as well, but Vin beat me too it.

However, if you have both locations running on the same server, you might be able to set an absolute path in the config. i.e. /var/www/root/mywebsite1.tld/htmlroot/forum/
and /var/www/root/mywebsite2.tld/htmlroot/forum/
Just though of it, I have no idea if it will work, but I intend to try.
I actually am going to have 3 boards be shared by 2 websites each.
(total of 6 websites).
Then there is a curve ball.
I'm going to have one board access a sertain set of categories, while the second access only some of the categories from the first, and different catogores that one can't see.
So although the structure would be like so:
Example:
  • Category1
  • Category2
  • Category3
  • Category4
  • Category5
The first website would access:
  • Category1
  • Category3
  • Category5
And the second website would access:
  • Category2
  • Category4
  • Category5
If that is confusing, don't bother trying to desypher it. ;)

So I will have to figure out how to do it, but I'm confident that I'll be able to.
I already have several ideas in the pan with how I'm going to accomplish this.
Image

Post Reply