Advanced search  

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]

Pages: [1]   Go Down

Author Topic: Moving Pictures (on the server)  (Read 7607 times)

0 Members and 1 Guest are viewing this topic.

sgodun

  • Coppermine newbie
  • Offline Offline
  • Posts: 3
Moving Pictures (on the server)
« 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?
« Last Edit: June 10, 2006, 05:20:19 am by Paver »
Logged

Nibbler

  • Guest
Re: Moving Pictures (on the server)
« Reply #1 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.
Logged

sgodun

  • Coppermine newbie
  • Offline Offline
  • Posts: 3
Re: Moving Pictures (on the server)
« Reply #2 on: June 09, 2006, 07:33:43 pm »

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

sgodun

  • Coppermine newbie
  • Offline Offline
  • Posts: 3
Re: Moving Pictures (on the server)
« Reply #3 on: June 10, 2006, 04:23:13 am »

This worked perfectly. Thanks for the help!
Logged

mmseng

  • Coppermine newbie
  • Offline Offline
  • Posts: 3
Re: Moving Pictures (on the server)
« Reply #4 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".
Logged
Pages: [1]   Go Up
 

Page created in 0.027 seconds with 20 queries.