forum.coppermine-gallery.net

Support => cpg1.4.x Support => Older/other versions => cpg1.4 miscellaneous => Topic started by: jlwagner on July 28, 2008, 06:34:30 pm

Title: Move albums from the Main gallery to User Galleries
Post by: jlwagner on July 28, 2008, 06:34:30 pm
When I started setting up my Coppermine Gallery, I bulk uploaded my albums in the Main Gallery. Now that I understand Coppermine slightly better, I would like to move the albums from the Main gallery to my User Gallery. Is there any way to do this?

I did a search which found a thread (http://forum.coppermine-gallery.net/index.php/topic,10286.0/topicseen.html) that I thought was the identical question, in which Joachim tersely responded, "not out of the box".  But I am comfortable working "outside the box" with MySQL, so I would like to re-ask this question. 

In that thread, Joachim also questioned why anyone would want to move the albums, and suggested using categories instead.  My answer is as follows:

My new site will have many relatives uploading family scrapbooks, and I am just one of their peers in that regard.  Their photos are uploaded to User Galleries.  Keywords are used to aggregate the photos by subject; they will appear in subject-specific albums in the Main Gallery.  As a newcomer to Coppermine admin, I bulk uploaded some of my albums to the Main Gallery, but my personal scrapbooks should not receive preferential treatment.  How can I move them to a User Gallery of my own? 

I apologize to Joachim for posting my response to the original thread.  I appreciate his quick reactions to postings; the level of support is terrific.  Unfortunately, the original thread was in the wrong forum, so my reply was as well.  He scowled heavily in my direction and locked that thread.  Very sorry to have aggravated anyone.  Thanks for listening.

I am now browsing in the database tables.  Would the following procedure work?

1.  Log in as admin, and add a new user for my non-admin, personal self.
2.  Log-in as the new personal user and add some empty albums in my User Gallery.
3.  Note the album-id's of the new User albums in the MySQL albums table.
4.  Run some queries on the pictures table to change all photos having one of the old album-id's to one of the new album-id's.
5.  Run one query to change all photos having the admin's ownerID to the new personal OwnerID. 
6.  Log in as Admin and delete the now empty Main albums; and make sure the properties for the new User albums are set to what the properties of the old ones were.

Does this sound like it would work?  Is there a preferable way?

Thank you for your attention.

--- Jordan


 


Title: Re: Move albums from the Main gallery to User Galleries
Post by: jlwagner on July 29, 2008, 07:48:09 am
For the benefit of others who may want to do the same thing, I report that I tried it and it seems to work, but with one additional step needed:
You also need a query to update the 'owner_name' field in the pictures table. 

I don't understand yet why the pictures table needs both an owner-id field and an owner-name field; seems redundant.  Also don't understand yet why that field isn't in the album table's records instead of the pictures table.  (So far, I've been thinking that all photos in an album are always owned by the album owner.)

Anyway, the bottom line is that this procedure appears to have moved the albums from the Main Gallery to the Users Gallery successfully.  (As always, backup your database first.)

If anything comes back to bite me later, I'll come back here to warn ya.