Advanced search  

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Pages: [1]   Go Down

Author Topic: multiple cpg installations using the same database?  (Read 6219 times)

0 Members and 1 Guest are viewing this topic.

Lara

  • Coppermine newbie
  • Offline Offline
  • Posts: 14
multiple cpg installations using the same database?
« on: December 21, 2005, 05:41:25 pm »

I am just wondering if it is possible installing coppermine in multiple directories using one single database? The reason therefor is that I run a multilingual website and wouldn't like to have my structure "destroyed" placing the gallery outside the language directories. Instead I would prefer installing coppermine in each of my two language folders but using a single database for it. Would that work at all?
Logged

Tranz

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Gender: Female
  • Posts: 6149
Re: multiple cpg installations using the same database?
« Reply #1 on: December 21, 2005, 05:44:28 pm »

Yes, you just need to use a different table prefix for the second installation.
Logged

Lara

  • Coppermine newbie
  • Offline Offline
  • Posts: 14
Re: multiple cpg installations using the same database?
« Reply #2 on: December 21, 2005, 05:56:16 pm »

Maybe I expressed myself a bit confusing. I want to use one database and one table(prefix) = same content for all installations. It should only be placed in different directories due to my structure. I am just a bit uncertain about this because in the coppermine configuration I need to  insert the path of the installation which is saved in the database (I suppose). Does it have any negative effects if place cpg in different directories using one database/table_prefix but the path of the installation is only saved once in the database?


the structure should be like this:

de
--news
--photos
-----photos/cmg
--links
--contact

en
--news
--photos
-----photos/cmg
--links
--contact

BUT using a single database / table structure
« Last Edit: December 21, 2005, 06:01:45 pm by Lara »
Logged

Nibbler

  • Guest
Re: multiple cpg installations using the same database?
« Reply #3 on: December 21, 2005, 06:24:53 pm »

Say for example you have Coppermine 'A' and Coppermine 'B'. First install these using different prefixes and check it all works. Then you can tell Coppermine B to use some of the tables that belong to Coppermine A by changing this code in init.inc.php

Code: [Select]
$CONFIG['TABLE_PICTURES']   = $CONFIG['TABLE_PREFIX'].'pictures';
$CONFIG['TABLE_ALBUMS']     = $CONFIG['TABLE_PREFIX'].'albums';
$CONFIG['TABLE_COMMENTS']   = $CONFIG['TABLE_PREFIX'].'comments';
$CONFIG['TABLE_CATEGORIES'] = $CONFIG['TABLE_PREFIX'].'categories';
$CONFIG['TABLE_CONFIG']     = $CONFIG['TABLE_PREFIX'].'config';
$CONFIG['TABLE_USERGROUPS'] = $CONFIG['TABLE_PREFIX'].'usergroups';
$CONFIG['TABLE_VOTES']      = $CONFIG['TABLE_PREFIX'].'votes';
$CONFIG['TABLE_USERS']      = $CONFIG['TABLE_PREFIX'].'users';
$CONFIG['TABLE_BANNED']     = $CONFIG['TABLE_PREFIX'].'banned';
$CONFIG['TABLE_EXIF']       = $CONFIG['TABLE_PREFIX'].'exif';
$CONFIG['TABLE_FILETYPES']  = $CONFIG['TABLE_PREFIX'].'filetypes';
$CONFIG['TABLE_ECARDS']     = $CONFIG['TABLE_PREFIX'].'ecards';
$CONFIG['TABLE_TEMPDATA']   = $CONFIG['TABLE_PREFIX'].'temp_data';
$CONFIG['TABLE_FAVPICS']    = $CONFIG['TABLE_PREFIX'].'favpics';
$CONFIG['TABLE_BRIDGE']     = $CONFIG['TABLE_PREFIX'].'bridge';
$CONFIG['TABLE_VOTE_STATS'] = $CONFIG['TABLE_PREFIX'].'vote_stats';
$CONFIG['TABLE_HIT_STATS']  = $CONFIG['TABLE_PREFIX'].'hit_stats';

For example you can do this:

Code: [Select]
$CONFIG['TABLE_PICTURES']   = 'prefix_of_coppermine_a'.'pictures';
$CONFIG['TABLE_ALBUMS']     = 'prefix_of_coppermine_a'.'albums';
$CONFIG['TABLE_COMMENTS']   = 'prefix_of_coppermine_a'.'comments';
$CONFIG['TABLE_CATEGORIES'] = 'prefix_of_coppermine_a'.'categories';
$CONFIG['TABLE_CONFIG']     = $CONFIG['TABLE_PREFIX'].'config';
$CONFIG['TABLE_USERGROUPS'] = 'prefix_of_coppermine_a'.'usergroups';
$CONFIG['TABLE_VOTES']      = 'prefix_of_coppermine_a'.'votes';
$CONFIG['TABLE_USERS']      = 'prefix_of_coppermine_a'.'users';
$CONFIG['TABLE_BANNED']     = 'prefix_of_coppermine_a'.'banned';
$CONFIG['TABLE_EXIF']       = 'prefix_of_coppermine_a'.'exif';
$CONFIG['TABLE_FILETYPES']  = 'prefix_of_coppermine_a'.'filetypes';
$CONFIG['TABLE_ECARDS']     = 'prefix_of_coppermine_a'.'ecards';
$CONFIG['TABLE_TEMPDATA']   = 'prefix_of_coppermine_a'.'temp_data';
$CONFIG['TABLE_FAVPICS']    = 'prefix_of_coppermine_a'.'favpics';
$CONFIG['TABLE_BRIDGE']     = 'prefix_of_coppermine_a'.'bridge';
$CONFIG['TABLE_VOTE_STATS'] = 'prefix_of_coppermine_a'.'vote_stats';
$CONFIG['TABLE_HIT_STATS']  = 'prefix_of_coppermine_a'.'hit_stats';

That will link them together but also allow them to have different config settings.
Logged

Lara

  • Coppermine newbie
  • Offline Offline
  • Posts: 14
Re: multiple cpg installations using the same database?
« Reply #4 on: December 22, 2005, 03:00:52 pm »

That sounds interesting. I will try that. Thanks.
Logged

Abbas Ali

  • Administrator
  • Coppermine addict
  • *****
  • Country: in
  • Offline Offline
  • Gender: Male
  • Posts: 2165
  • Spread the PHP Web
    • Ranium Systems
Re: multiple cpg installations using the same database?
« Reply #5 on: December 22, 2005, 03:40:09 pm »

Another approach would be....

First install coppermineA. Then just copy coppermine files to coppermineB (don't install coppermineB).

Copy coppermineA/includes/config.inc.php to coppermineB/includes/config.inc.php

Then remove/rename coppermineB/albums folder and create a symlink coppermineB/albums poiting to coppermineA/albums  If you don't have ssh access to your site then you will need to ask your webhost to create symlink.

Doing above steps will ensure that both installations use same database as well as share same photos.
Logged
Chief Geek at Ranium Systems

dolomites

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 22
Re: multiple cpg installations using the same database?
« Reply #6 on: February 09, 2012, 01:09:52 pm »

I tried this (with 1.5) with two galleries A & B

tables on same database with different prefixes

on B same data of A on config.php with different prefixes

init.inc.php of gallery B

$CONFIG['TABLE_PICTURES']      = $CONFIG['TABLE_PREFIX'].'pictures';
$CONFIG['TABLE_ALBUMS']        = $CONFIG['TABLE_PREFIX'].'albums';
$CONFIG['TABLE_COMMENTS']      = $CONFIG['TABLE_PREFIX'].'comments';
$CONFIG['TABLE_CATEGORIES']    = $CONFIG['TABLE_PREFIX'].'categories';
$CONFIG['TABLE_CONFIG']        = $CONFIG['TABLE_PREFIX'].'config';
$CONFIG['TABLE_USERGROUPS']    = 'prefix of A_'.'usergroups';
$CONFIG['TABLE_VOTES']         = $CONFIG['TABLE_PREFIX'].'votes';
$CONFIG['TABLE_USERS']         = 'prefix of A_'.'users';
$CONFIG['TABLE_BANNED']        = 'prefix of A_'.'banned';
$CONFIG['TABLE_EXIF']          = $CONFIG['TABLE_PREFIX'].'exif';
$CONFIG['TABLE_FILETYPES']     = $CONFIG['TABLE_PREFIX'].'filetypes';
$CONFIG['TABLE_ECARDS']        = $CONFIG['TABLE_PREFIX'].'ecards';
$CONFIG['TABLE_FAVPICS']       = $CONFIG['TABLE_PREFIX'].'favpics';
$CONFIG['TABLE_BRIDGE']        = $CONFIG['TABLE_PREFIX'].'bridge';
$CONFIG['TABLE_VOTE_STATS']    = $CONFIG['TABLE_PREFIX'].'vote_stats';
$CONFIG['TABLE_HIT_STATS']     = $CONFIG['TABLE_PREFIX'].'hit_stats';
$CONFIG['TABLE_TEMP_MESSAGES'] = $CONFIG['TABLE_PREFIX'].'temp_messages';
$CONFIG['TABLE_CATMAP']        = $CONFIG['TABLE_PREFIX'].'categorymap';
$CONFIG['TABLE_LANGUAGE']      = $CONFIG['TABLE_PREFIX'].'languages';
$CONFIG['TABLE_DICT']          = $CONFIG['TABLE_PREFIX'].'dict';

same cookies name

and It doesn't work....users are created on A users but login of B doesn't recognize users.....it's incredible! Why?
Logged
Pages: [1]   Go Up
 

Page created in 0.178 seconds with 21 queries.