Merge 2 galleries (and 2 databases) into 1 single gallery. Merge 2 galleries (and 2 databases) into 1 single gallery.
 

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Main Menu

Merge 2 galleries (and 2 databases) into 1 single gallery.

Started by bbm, August 14, 2007, 12:44:33 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

bbm

I run 2 galleries on my site, they run in the /pix2 and /pixu directories.
Both run CPG 1.4.12 and they run very nicely. :)
/pix2 has 1800 pics (previously ran cpg149_) and
/pixu has 4000 pics (previously ran cpg132_)  ;D

I have created a an "interface" for navigating between these galleries.
(visit www.bombelman.com to see this)

I would like to be able to use RSS in the future, but 1 for the whole site,
not one separare for each gallery.  :o

I would thus like to merge both Coppermines + DBs into 1 single gallery.
This for reasons other the the RSS-thingy alone.
Like having to change each theme, whenever the other also changes.
(I did hack both galleries to use one single theme.  :P ;D)

I (re)searched the threads about this subject and there were a few
users wanting to do this, but there is no mod, plugin or fixed script
available to modify, copy and merge the databases into eachoter.
(pic-ID's need to be copied and be unique).
In other words, there was no real solution other then to dive into
the DB itself and merge the DB manualy.  :D

I'm wiling to do this for the "few" pics I currently host, before it
gets even BIGGER !  ::)

Here is what I plan to do:
1) Clone the galleries into a test-dir where I will perform the ritual.
2) Clone DBs to test-dbs.
3) Make back-ups of both galleries AND both databases (just in case).

Next, I copy the albums from /pixu gallery to the /pix2.
I would then need top copy the "info" from my cpg132_pictures
to the cpg149_pictures. (BTW, I'm the only one publishing pics.)

Here's the big question:
Is "PID" the only field that should be unique, and can I just change
these numbers to number that were not yet used in cpg149_, without
risking this info to be overwritten when uploading new pics ?

Would I do the same for the Albums ?

The Priority for merging is:
1) pictures
2) comments+hits (maybe ratings?)

next chapter:
3) users
4) e-cards etc.

Let's hope this works. Thanks everyone in advance for your input.

Nibbler

You need to update the other tables that refer to the pid with the updated values.

bbm

Some updates:

I would also need to update the AID (Album ID).

Here's a question, which could save me time if it's doable:
For the PIDs and AIDs I copy into an existing DB, before I
copy then, can I place prefixes before them, for instance
that all AIDs and PIDs from the to be merged DB get a letter
like "A" ? This would mean I would need to change the int(11)
to varchar255, or can I use a numerical prefix like "90" ?

The first AID of the to merge DB would be either "A1" or "901".

Would using any prefix at all have any effect on the
functionality of Coppermine ?

Cheers !!

Nibbler

You can't use letters, that would mess everything up.

bbm

Ok, no letters.
But you did not say if using "90" as a prefix for AID or PID is better or less worse ?  ???

Nibbler