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: Clean out old photos from database?  (Read 2974 times)

0 Members and 1 Guest are viewing this topic.

fribse

  • Coppermine newbie
  • Offline Offline
  • Posts: 14
Clean out old photos from database?
« on: October 20, 2010, 03:34:47 pm »

I've posted this under 1.4/misc as well, but I've moved the gallery to 1.5, so this is probably a better place to post it.
After I've renamed some folders that contained pictures already included in albums, it still has the old picturesit fails to load.
I need to have them cleaned out from the database, some sort of 'validate all pictures' would be great, or at least clear out an album for all pictures, so I can readd them.
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15760
Re: Clean out old photos from database?
« Reply #1 on: October 20, 2010, 04:17:54 pm »

Afaik Coppermine don't has such a mechanism. But you could write a simple script that deletes database entries if the file_exists function detects missing files.
Logged

hobert

  • Contributor
  • Coppermine novice
  • ***
  • Country: us
  • Offline Offline
  • Gender: Male
  • Posts: 29
Re: Clean out old photos from database?
« Reply #2 on: October 21, 2010, 04:01:24 pm »

Here's a small mod I wrote for 1.4 that will automatically check the "delete" box in editpics.php if the original file source is missing.  It's still working fine in 1.5.8 as far as I can tell.

This will also get rid of the thumbnail and other pictures if they are left behind.

http://forum.coppermine-gallery.net/index.php/topic,61925.0.html
Logged

fribse1

  • Coppermine newbie
  • Offline Offline
  • Posts: 4
Re: Clean out old photos from database?
« Reply #3 on: October 22, 2010, 07:33:54 am »

Very neat mod, but I can't get it working.
Problem is very strange.
If I go to 'edit files' it ONLY lists the files that are really there, not the bad ones that are missing??? So it doesn't show any checkmarks for deleting them :-(
I think the database has gone haywire over this.
I wonder if it will allow me to delete the album in it's enitirity, and just bulk add them back in...
Logged

fribse

  • Coppermine newbie
  • Offline Offline
  • Posts: 14
Re: Clean out old photos from database?
« Reply #4 on: October 29, 2010, 09:13:56 am »

Can anybody tell me how to directly manipulate the database to completely remove the album (I'll just readd the album afterwards with batch load).
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15760
Re: Clean out old photos from database?
« Reply #5 on: October 29, 2010, 09:28:41 am »

If you want to remove the files of an album, you'll have to delete the appropriate entries (have a look at the column 'aid') in the pictures table.
If you want to remove the album, too, you'll have to delete the entry in the albums table.
According to your Coppermine setup you'll have to clean the comments table and maybe the stats tables, too.
Logged

fribse

  • Coppermine newbie
  • Offline Offline
  • Posts: 14
Re: Clean out old photos from database?
« Reply #6 on: October 31, 2010, 01:40:49 pm »

Excellent, got them removed, now on to adding them back in  ;D
Thanks!
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15760
Re: Clean out old photos from database?
« Reply #7 on: October 31, 2010, 04:19:39 pm »

Logged
Pages: [1]   Go Up
 

Page created in 0.025 seconds with 21 queries.