forum.coppermine-gallery.net

Support => cpg1.4.x Support => Older/other versions => cpg1.4 upload => Topic started by: sgodun on June 09, 2006, 02:08:23 pm

Title: Moving Pictures (on the server)
Post by: sgodun on June 09, 2006, 02:08:23 pm
I have a gallery that contains about 300 pictures, which were laboriously uploaded five at a time through the Coppermine interface. (Don't ask.) I would like to move these pictures to their own folder (as if I were batch-adding the pics). I can move the files, the "normal" versions, and the "thumb" versions into their own folder without incident, but then I have to modify the Coppermine database to point to the new files.

I can simply delete all the pictures from the gallery and then re-add them to the gallery using the "batch add" command but then I'll lose all the comments, ratings and other metadata.

Keeping in mind that I'm only VERY lightly familiar with SQL manipulation (that is to say, I can do things manually through the phpMySQL interface), what's the fastest/easiest way to modify my Coppermine database to effectively say, "the 300 files, thumbnails, and 'normal' pictures you're looking for aren't in THIS folder, they're all in THIS folder"? And is it even possible to do so?
Title: Re: Moving Pictures (on the server)
Post by: Nibbler on June 09, 2006, 03:42:24 pm
UPDATE cpg_pictures SET filepath = '/new/file/path/' WHERE filepath = '/old/file/path/';

Backup your db before you run and change the prefix to the actual prefix you use.
Title: Re: Moving Pictures (on the server)
Post by: sgodun on June 09, 2006, 07:33:43 pm
Suh-weet! Thanks. I'll give it a try tonight!
Title: Re: Moving Pictures (on the server)
Post by: sgodun on June 10, 2006, 04:23:13 am
This worked perfectly. Thanks for the help!
Title: Re: Moving Pictures (on the server)
Post by: mmseng on January 18, 2011, 07:24:02 am
Sorry for the gravedigging here, but I am in the same situation and am just wondering if there would be any problems with this procedure now, 4.5 years later. I have to assume the CPG codebase has changed significantly in that time and don't want to blindly follow outdated advice. I can do the web searching needed to perform any more steps that may need to be done, just looking for a general direction and maybe a "yeah that should still be fine", or a "heck no that won't work anymore".