williamleonard / obblm

Automatically exported from code.google.com/p/obblm
1 stars 0 forks source link

prefix database tables with obblm_ #7

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Iam just about to install the league to an already existing website when I
realised that it might come to problems with already existing tables. Many
products I know prefix their tables (burning board forum bb1_, ...).

I suggest prefixing the obblm tables with obblm_ just to avoid conflicts
with other products.

Original issue reported on code.google.com by juergen....@gmail.com on 1 Feb 2009 at 2:21

GoogleCodeExporter commented 9 years ago
It would be neat to have two separate OBBLM installed side by side, using same
database. Especially in the case of hosting when you often only get one DB.

So I looked very quickly at doing a script for renaming the stuff needed to do 
that.
It wasn't as easy as a simple grep-and-replace script, since there are comments 
and
variables that also get hit by that. :-/ With an initial manual prefixing as 
Juergen
requested a grep-and-replace script would be easier to do.

/Daniel

Original comment by blodae@gmail.com on 4 Feb 2009 at 12:33

GoogleCodeExporter commented 9 years ago
Yes, it's going to be difficault replacing the correct table names since some 
tables
names are also used in the php code. I don't really know how to do this 
easiest. I
can't think of how to compile a regular expression that would match only table 
names
within sql queries.

If doing this, then yes, of course, it should be not only a obblm_ prefix, but 
some
string that one can set in the settings file.

Original comment by Nimda...@gmail.com on 4 Feb 2009 at 1:38

GoogleCodeExporter commented 9 years ago
get_alt_col() needs to be changed too.

Original comment by blodae@gmail.com on 5 Feb 2009 at 7:35

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
I just done the same in my obblm installation.

I duplicated the obblm DB to another obblm_alt DB [_alt stands for the 
alternative
name You choose], copied ALL the files into a \alt sub directory, and changed 
the
settings.php file to connect to the obblm_alt DB instead than to the existing 
obblm DB.

This required to me 4 clicks, using the PHP admin web interface my ISP let at my
disposal.

1. Exported the DB with structure rebuild commands;
2. Created the a new empty DB (obblm_alt);
3. Imported the SQL DB previously exported;
4. Emptied ALL the tables to restart from scratch.

Then I changed the settings.php file to the new needed settings, and get to 
work on it.

These are the two links:
MAIN DB: http://obblm.treemme.org/
_ALT DB: http://obblm.treemme.org/mnt/

Go for it...!!! And don't roll ones. ;-p

Fabio

Original comment by SincreT...@gmail.com on 5 Feb 2009 at 3:53

GoogleCodeExporter commented 9 years ago
My problem is that I only have one DB at my hosting. :-/

Original comment by blodae@gmail.com on 5 Feb 2009 at 5:10

GoogleCodeExporter commented 9 years ago
Yep. The reason for implementing this is to (a) avoid table duplicate names for 
two
pieces of software wanting to use the same table name, and (b) allow multiple
instances of obblm on one DB.

Original comment by Nimda...@gmail.com on 6 Feb 2009 at 9:17

GoogleCodeExporter commented 9 years ago

Original comment by Nimda...@gmail.com on 13 Feb 2009 at 12:34

GoogleCodeExporter commented 9 years ago
I was just thinking about this as I went a step further with giving wikimedia 
the 
ability to host as many separate wikis as you'd like using just 1 installation. 
 Off 
hand I may be missing something but here are the basics:

During installation the script captures the subdomain as the prefix.
It creates all the tables with this prefix.
Code in wikimedia already is set to have a variable infrom of the tables name 
for a 
prefix.
Create the settings file with the prefix as well, subdomain_settings.php.
Either exclude prefixes less than 4 characters or specifically exclude www.
Just something to think about since you are starting from scratch with this.  
You 
can basically have as manay installations as you want using just 1 installation.

Original comment by funnyfin...@hotmail.com on 1 May 2009 at 1:06

GoogleCodeExporter commented 9 years ago
That's not the point - in fact, what you are commenting is the only proper way 
of
doing it as far as I see it.
The point is, that it's a huge job going through each mysql query in the obblm 
code
to add a table prefix variable.

Original comment by Nimda...@gmail.com on 1 May 2009 at 2:33

GoogleCodeExporter commented 9 years ago
Oh ok.  I didn't fully understand the way you were looking at it.  I 
specifically 
mention the single installation idea with the subdomain because when I was 
researching the multiple wiki installations, the people doing multiple wikis on 
the 
same installation were using some off the wall things, instead of just using a 
prefixed settings file as well.

Not sure if owner juergen.unfried means that he is doing this, but with you 
getting 
really busy soon, would you like me to do the busy work and prep this by 
setting a 
prefix to "" and adding it to all the code?  I could do this in another branch.

Original comment by funnyfin...@hotmail.com on 1 May 2009 at 5:08

GoogleCodeExporter commented 9 years ago
OK.
Thanks, but I would prefer if we let this one settle a bit longer, I'm doing 
some
research into other ways of solving this issue.

Original comment by Nimda...@gmail.com on 1 May 2009 at 8:00

GoogleCodeExporter commented 9 years ago

Original comment by Nimda...@gmail.com on 11 Jul 2009 at 11:02

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago

Original comment by Nimda...@gmail.com on 20 Jul 2009 at 12:06

GoogleCodeExporter commented 9 years ago
I am posting this here as it is related to multiple installs on one domain 
name...

I may be wrong here, but I think that the SESSION would be used by all sub
directories in the same domain.  This would mean that 
http://www.example.com/OBBLM1
could log in as root and have full control over http://www.example.com/OBBLM2.

Is this a valid concern?  If so can you configure the session to use an ID 
based on
the path of the OBBLM installation?

Original comment by funnyfin...@hotmail.com on 11 Aug 2009 at 11:33

GoogleCodeExporter commented 9 years ago
Yes, that is correct. It is related to the server on which the subdivision are 
run.
It's an apache/ISS config, which is why we can't use this as a solution.

Original comment by Nimda...@gmail.com on 14 Aug 2009 at 7:53

GoogleCodeExporter commented 9 years ago
So if you did eventually do prefixes so that site's can run multiple 
installations 
of OBBLM, they would have to use subdomains.

Original comment by funnyfin...@hotmail.com on 19 Aug 2009 at 2:19

GoogleCodeExporter commented 9 years ago
Oh I think .htaccess can do it for apache to allow the subdirectories to have 
their 
own cookies.  I will test it out tonight.

Original comment by funnyfin...@hotmail.com on 19 Aug 2009 at 3:52

GoogleCodeExporter commented 9 years ago
Is this prefix something that will eventually be done?  If so I suggest using 
constants instead.  This could give greater flexibility in choosing the exact 
names 
of the tables being used.

Original comment by funnyfin...@hotmail.com on 3 Sep 2009 at 4:13

GoogleCodeExporter commented 9 years ago
Actually I don't think so. 
I'm not satisfied with the solutions available, and I don't trust a script to 
look
through all files and do "intelligent" substitution. It'll have to wait for some
(unlikely) future rewrite. Closing.

Original comment by Nimda...@gmail.com on 3 Sep 2009 at 4:54

GoogleCodeExporter commented 9 years ago
Issue 271 has been merged into this issue.

Original comment by Nimda...@gmail.com on 12 Oct 2009 at 2:48