Is there a quick and painless way to remove "missing" items from G2 database?

wolfeman

Joined: 2004-09-02
Posts: 25
Posted: Sun, 2005-12-04 03:34

Long story short, since installing G2 I have seen an exponential number of visitors to my site and uploads have increased from 200-300 a week to about 1,000-2,000 a week.

This is great except that I am having difficulty in managing so many photos. I keep getting time out errors or memory errors when trying to move around more than 50-100 pics at a time.

I needed to zap a directory with about 3,000+ pics in it and G2 simply could not do it from the web front end side so I zapped it via FTP. [yeah I know, stupid]

now of course the database entries are still there and now that the actual items are missing G2 does not want to delete anything because I keep getting a missing item error.

aside from going in to the database and manually removing 3,000+ entries in a database with over 10,000 items, is there a quick fix to this problem?

[damn I hope so]

many thanks in advance for anyone who has some advice

-mw

Gallery version = 2.0.1 core 1.0.0.1
PHP version = 4.3.3 apache
Webserver = Apache
Database = mysql 3.23.58
Toolkits = ArchiveUpload, Exif, ImageMagick, SquareThumb, Thumbnail, Gd, Ffmpeg
Operating system = Linux Sat Apr 30 00:20:10 EDT 2005 i686
Browser = Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en-us) AppleWebKit/312.5.1 (KHTML, like Gecko) Safari/312.3.1

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Sun, 2005-12-04 19:32

@memory error:
-> increase your php memory_limit

@timeouts:
not sure if we improved that for move items since 2.0.1
maybe try the latest nightly snapshot of g2. (core version 1.0.10)

@quick fix:
no

@fixing the issue:
yeah, doing something in g2data wasn't the best idea. and manually cleaning it up won't be easy.
in the db table g2_Item you have to find out what id the album had.
if this album had subalbums with subsubitems etc. you'll havr to query g2_ItemAttributesMap for all items with a parentSequence 7/.../albumId/
if it was an album with some images only (no subsubitems), you can just use g2_ChildEntity to find out all g_id with g_parentId = the album id you found out in g2_Item .

then you'll have to delete all rows in g2_entity, g2_ChildEntity, g2_Item, g2_FilesystemEntity, g2_DataItem, g2_AlbumItem, ........... with rows with g_id = items you deleted.
if the album had comments, also delete the comments etc.
all in all, quite complicated.

then you'll have to

 
wolfeman

Joined: 2004-09-02
Posts: 25
Posted: Sun, 2005-12-04 20:32

"then you'll have to" ... was there more to your post ??

thanks for the reply. I was afraid it would be complicated. the directory had 3,000+ imiages and about 10-20 albums with varying amounts of images in them as well.

all in all, not pretty and it was hell to administrate in that album trying to delete or move anything.

it would be nice if there was some sort of module that checked for broken links and fixed them in the database.

oh well, lesson learned

thanks
-mw

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Sun, 2005-12-04 23:53

@"then you'll have to", no, just an artifact :)

there are tasks for checking the data integrity in the database etc. but it's not even in the planning phase.