[rt-users] fixing attributes with a CLI script

Geoff Crompton geoffc at trinity.unimelb.edu.au
Sun May 22 21:12:23 EDT 2011


Hi,

I'm trying to repair my searches on test RT installation that I've 
upgraded from rt3.6 to rt3.8. This problem is described on 
http://requesttracker.wikia.com/wiki/RepairSearches

Rather than doing this manually, or just deleting all saved searches I'm 
trying to do this with a script. I've copied the 
/usr/sbin/rt-dump-database-3.8 as a starting point, and stripped out 
things I don't need from that script.

According to my print statements the script is doing what I want, but 
the changes are not sticking to the database. I'm calling 
$attribute->SetAttribute() to update the attributes I want to change. 
Despite this after running the script the searches are still incorrect.

I've been reading the RT::Record code, but I don't know what I'm doing 
wrong. I thought maybe I wasn't committing a transaction, but adding 
'$RT::Handle->BeginTransaction() and $RT::EndTransaction() didn't change 
things.

Any tips on how to get these changes to make it to the database?

-- 
+-Geoff Crompton
+--Debian System Administrator
+---Trinity College



More information about the rt-users mailing list