Advanced search  

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

Pages: [1]   Go Down

Author Topic: Bridging Standalone SMF and Coppermine Installations  (Read 4930 times)

0 Members and 1 Guest are viewing this topic.

afrohead

  • Coppermine newbie
  • Offline Offline
  • Posts: 11
Bridging Standalone SMF and Coppermine Installations
« on: February 08, 2008, 08:04:09 pm »

I have had a standalone version of SMF and Coppermine running for some time now and I would really like to integrate the two.  The Installation manual for Coppermine is very clear that private albums and existing CM users will be lost after bridging the standalone apps.  My question is would there be any creative ways around losing all private albums after the bridging is done?  Would it be possible to install a fresh copy of CM in another directory say, and then copy the albums I don't want to lose to the new install and assign the album to an integrated user?  Or could the private albums I want to keep be preserved some other way and then be reassigned to users after the integration?  I really believe there would be some way to accomplish the preservation of existing private albums and to reassign those albums back to the users that were integrated rather than losing them completely.

Here is one more related question - if my users in my CM have the exact same usernames as the users in my SMF couldn't the Album ownership associations be preserved after integrating the two apps?

I'm hungry and will appreciate any food for thought.

Thanks - Coppermine continus to blow me away with its capabilities, power, and that it remains free.
« Last Edit: February 09, 2008, 09:58:45 am by Joachim Müller »
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: Bridging Standalone SMF and Coppermine Installations
« Reply #1 on: February 08, 2008, 08:19:31 pm »

I have had a standalone version of SMF and Coppermine running for some time now and I would really like to integrate the two.  The Installation manual for Coppermine is very clear that private albums and existing CM users will be lost after bridging the standalone apps.  My question is would there be any creative ways around losing all private albums after the bridging is done?
You won't actually lose anything, but the correlation will be lost. Read up the more detailed explanation about what will happen in the preliminary documentation for cpg1.5.x:
Quote
Coppermine users, groups and pics uploaded by users are lost when integrating

Warning: If you already have users and custom groups in your coppermine database when you enable bridging, be aware that they will be lost. If your coppermine users have already created private albums and uploaded pics to them, they will be lost as well!

Detailed explanation:
As most community applications, coppermine stores everything that users (including the admin) do (like uploading pics, posting comments, rating files) inside the database. The reference to each user action is being kept using a unique user ID. The correlation between the user actions and the corresponding user profile is being kept by storing the user ID within each record in the database that determines the user action.
When bridging is enabled, coppermine's user management is being dropped in favor of the user management that comes with the application you bridge with. Subsequently, the user IDs from your bridging app (that differ from Coppermine's user IDs) are being taken into account.

Example:
Coppermine-user "Bill" has got the coppermine user ID "3". He used to upload several pics that went into the folder /albums/userpics/10003/. The URL of his personal gallery used to be http://yoursite.tld/your_coppermine_folder/index.php?cat=10003.
In the BBS application, the user "Linus" has got the user ID "3".
After enabling bridging, the URL http://yoursite.tld/your_coppermine_folder/index.php?cat=10003 points to the personal gallery of the user "Linus". All pics that Bill used to upload appear to be owned by Linus.

Summary:
Correlation between the actions that the unbridged coppermine users have performed and the "new" accounts from the app you bridged with is lost. Subsequently, you don't actually loose files that have been uploaded previously, but they appear to have been uploaded by a different user.

Would it be possible to install a fresh copy of CM in another directory say, and then copy the albums I don't want to lose to the new install and assign the album to an integrated user?
That's nonsense and would not change anything.

Here is one more related question - if my users in my CM have the exact same usernames as the users in my SMF couldn't the Album ownership associations be preserved after integrating the two apps?
As suggested above: the user name is irrelevant. What really matters is the user ID.
What you could do is to manually edit stuff in the database (if you really know your way around).

Why don't you post a link to your gallery and your forum for a start, so we could try to determine the amount of work that would be necessary.
Logged

afrohead

  • Coppermine newbie
  • Offline Offline
  • Posts: 11
Re: Bridging Standalone SMF and Coppermine Installations
« Reply #2 on: February 08, 2008, 09:24:45 pm »

That was the best support followup I have ever received!  Thanks a lot Joachim!  The only question that remains for me now is can I reassociate the albums through the admin center or some other way through CM without having to do a bunch of database work?  In the example below where Linus becomes associated with Bill's Album after bridging would it be possible to reassociate Bill with his Albums and Pictures through CM or would I have to write some SQL to do this?  The good thing for me is that I have a small number of registered users in CM that are allowed to upload images (< 20).  Although my forum is huge (14000+) I think the CM reassociations would be manageable if I had to do some manual editing.  I am in the process of moving my site to another server and will post a link for you when I get it back up.  I think with some good advice I would be able to handle the database updates if need be...
Logged

Nibbler

  • Guest
Re: Bridging Standalone SMF and Coppermine Installations
« Reply #3 on: February 08, 2008, 09:45:33 pm »

If they do have the exact same usernames then you should in theory be able to reassign the pics, albums and comments with a few db queries. You'll need at least MySQL 4.1 for this, and it's untested so do it on a copy/backup. (Easy way to do this is with the table copy feature in phpmyadmin).

Code: [Select]
UPDATE cpg_pictures p SET owner_id = (SELECT ID_MEMBER FROM smf_members WHERE memberName = p.owner_name) WHERE owner_id <> 0
UPDATE cpg_albums a SET category = 10000 + (SELECT MAX(owner_id) FROM cpg_pictures p WHERE p.aid = a.aid) WHERE category > 10000
UPDATE cpg_comments c SET author_id = (SELECT ID_MEMBER FROM smf_members WHERE memberName = c.msg_author) WHERE author_id <> 0

Change the table name prefixes as appropriate.
Logged

afrohead

  • Coppermine newbie
  • Offline Offline
  • Posts: 11
Re: Bridging Standalone SMF and Coppermine Installations
« Reply #4 on: February 08, 2008, 10:43:24 pm »

I can't believe how good the support is on this forum  You guys rock.  Thanks so much.  It'll be a while before I pull the trigger on this.  If I get stuck I'll post here again.
Logged
Pages: [1]   Go Up
 

Page created in 0.05 seconds with 19 queries.