[rt-users] Mass Delete

Stephen Turner sturner at MIT.EDU
Tue Jan 23 16:12:07 EST 2007


> -----Original Message-----
> From: rt-users-bounces at lists.bestpractical.com 
> [mailto:rt-users-bounces at lists.bestpractical.com] On Behalf Of 
> Sent: Tuesday, January 23, 2007 4:00 PM
> To: rt-users at lists.bestpractical.com
> Subject: [rt-users] Mass Delete
> 
> I have a queue with over 15K spam messages in it, and I want to delete
> every one of those messages.  Using the bulk update for this really
> isn't feasible at 100 per page, and the browser runs out of memory if
> I do unlimited.
> 
> There are no other tickets in the queue, so I thought this might be a
> chance to just do some SQL queries directly on the database.  But I
> want to be as safe about it as I can be.  I can do a query like this:
> 
> update tickets set status = 'deleted' where queue = 42
> 
> (42 is the numeric id of the queue in question)
> But this dosnt update the transactions table.  Is that safe? It also
> seems kind of wasteful to keep all that data around when we have no
> need for it, so removing things from the attachments table popped into
> my head, but I wasnt sure how good of an idea that was either.
> 
> Has anyone ever had to deal with this? Whats the best way to 
> move forward?
> 
> Jay
> 

Jay,

If you actually want to remove the data from the database, check out
RTx::Shredder (http://wiki.bestpractical.com/index.cgi?Extensions).

Always be wary of using SQL directly to do updates in RT - you may break
something. It's useful to learn the RT API and do updates using a perl
script, rather than using SQL. 

Steve

----------------------------------------
Stephen Turner
Senior Programmer/Analyst - Client Support Services
MIT Information Services and Technology (IS&T)
  




More information about the rt-users mailing list