Connecting from one script to multiple RT

Hi RT hackers,

I’m writing a script that should copy some RT objects from one RT to
another.

For small set of objects, I can load them from first RT and save themin
memory, then use “RT->Config->Set(DatabaseHost…” and “RT::Init();” to
switch to the target and re-create objects on target.

But for a lot of objects, that will be too slow, and use too much
memory, so I would like to do thinks like:

my $SrcUser = RTSRC::User->new …
my $DstUser = RTDST::User->new …

any idea how to achieve this? I looked deep in perl object programming
but didn’t found a solution (maybe not deep enough). I thought also on
doing a copy of the code and rename every RT:: to RTSrc::, but that’s ugly and not
sure it will works.

if it’s not possible, I will do sql on src and RTApi on target :frowning:

Hi RT hackers,

I’m writing a script that should copy some RT objects from one RT to
another.

For small set of objects, I can load them from first RT and save themin
memory, then use “RT->Config->Set(DatabaseHost…” and “RT::Init();” to
switch to the target and re-create objects on target.

But for a lot of objects, that will be too slow, and use too much
memory, so I would like to do thinks like:

my $SrcUser = RTSRC::User->new …
my $DstUser = RTDST::User->new …

any idea how to achieve this? I looked deep in perl object programming
but didn’t found a solution (maybe not deep enough). I thought also on
doing a copy of the code and rename every RT:: to RTSrc::, but that’s ugly and not
sure it will works.

if it’s not possible, I will do sql on src and RTApi on target :frowning:

Hi Emmanuel,

how about using REST to connect to one or both RT?

Chris

how about using REST to connect to one or both RT?

I want so sync a lot of objects (users, groups, CF, tickets,
transactions, …) that will be too slow and need a lot of parsing.

Use a database replication layer?

how about using REST to connect to one or both RT?

I want so sync a lot of objects (users, groups, CF, tickets,
transactions, …) that will be too slow and need a lot of parsing.

What’s the actual use case / business requirement that needs these synced?

Best,
Jesse

What’s the actual use case / business requirement that needs these synced?

Import all tickets from a queue in a 3.4 running RT to a 3.8 RT with
others queues in production.

Why not just upgrade the production server?

SethOn 05/06/2010 12:45 PM, Emmanuel Lacour wrote:

On Thu, May 06, 2010 at 10:08:43AM -0400, Jesse Vincent wrote:

What’s the actual use case / business requirement that needs these synced?

Import all tickets from a queue in a 3.4 running RT to a 3.8 RT with
others queues in production.


List info: http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-devel

Seth Galitzer
Systems Coordinator
Computing and Information Sciences
Kansas State University
http://www.cis.ksu.edu/~sgsax
sgsax@ksu.edu
785-532-7790

Why not just upgrade the production server?

I’m not going to explain here all the background here, versions doesn’t
matter, the need is
as I explained, there is 2 RT servers with different versions, and we
wan’t to move one queue with all tickets contents from one RT to
another. Of course there will be a lot of ids changes (for every object,
but it’s not the problem here, I now how to do this and if I found no RT
api solutions, I can go the SQL way, but I always prefer to use api
that’s easier :wink:

the problem is that I have to walk through objects collection on src RT,
and inside this loop I have to do things on the other, I didn’t tried,
but I suppose that if I play with RT::Handle at this time it will break
current loop…

well let’s sleep, and hope an acceptable solution will appear :wink:

Emmanuel,

I think the easiest way is to write a thing like rt2 to rt3 script.
Two scripts: dumper into intermediate format and importer.On Fri, May 7, 2010 at 12:34 AM, Emmanuel Lacour elacour@easter-eggs.com wrote:

On Thu, May 06, 2010 at 03:13:48PM -0500, Seth Galitzer wrote:

Why not just upgrade the production server?

I’m not going to explain here all the background here, versions doesn’t
matter, the need is
as I explained, there is 2 RT servers with different versions, and we
wan’t to move one queue with all tickets contents from one RT to
another. Of course there will be a lot of ids changes (for every object,
but it’s not the problem here, I now how to do this and if I found no RT
api solutions, I can go the SQL way, but I always prefer to use api
that’s easier :wink:

the problem is that I have to walk through objects collection on src RT,
and inside this loop I have to do things on the other, I didn’t tried,
but I suppose that if I play with RT::Handle at this time it will break
current loop…

well let’s sleep, and hope an acceptable solution will appear :wink:


List info: http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-devel

Best regards, Ruslan.

Emmanuel,

I think the easiest way is to write a thing like rt2 to rt3 script.
Two scripts: dumper into intermediate format and importer.

I’m not very comfortable with dumping objects to a file, then loading
them again. So I made it using SQL on src and RT API on target (thought
skipping the Overlay for most objects to avoid some logic that may alter
data already processed).