Moving Pictures (on the server) Moving Pictures (on the server)
 

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]

Main Menu

Moving Pictures (on the server)

Started by sgodun, June 09, 2006, 02:08:23 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

sgodun

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?

Nibbler

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.

sgodun

Suh-weet! Thanks. I'll give it a try tonight!

sgodun

This worked perfectly. Thanks for the help!

mmseng

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".