Programatically creating tickets with specific id numbers

Dear all,

We’re in the process of migrating to RT from an ancient ticketing system.
I’d like to load our existing database of around 18,000 tickets into RT –
which seems eminently do-able using a bit of perl scripting. Except for
one thing: is it possible to set ticket ID numbers programatically? As
far as I can tell the ticket id is derived from an autoincrement value in
one of the DB tables and there’s no api for choosing a specific value.
Which makes it rather hard to preserve the existing ticket ID numbers.

If anyone can point me towards examples on the Net of code for doing this
sort of migration I’d be grateful.

Cheers,

Matthew

Dr Matthew Seaman The Bunker, Ash Radar Station
PGP: 0x60AE908C on servers Marshborough Rd
Tel: +44 1304 814890 Sandwich
Fax: +44 1304 814899 Kent, CT13 0PL, UK

signature.asc (259 Bytes)

We’re in the process of migrating to RT from an ancient ticketing system.
I’d like to load our existing database of around 18,000 tickets into RT –
which seems eminently do-able using a bit of perl scripting. Except for
one thing: is it possible to set ticket ID numbers programatically? As
far as I can tell the ticket id is derived from an autoincrement value in
one of the DB tables and there’s no api for choosing a specific value.
Which makes it rather hard to preserve the existing ticket ID numbers.

If anyone can point me towards examples on the Net of code for doing this
sort of migration I’d be grateful.

You might find that there is inspiration to be drawn from
dumpfile-to-rt-3.0, part of RT::Extension::RT2toRT3 available on CPAN.

Dominic Hargreaves, Systems Development and Support Team
Computing Services, University of Oxford

You can just alter the table to start auto_increment from a higher number…
So that RT starts from 18001->

Very easy to do with phpMyAdmin

Med vennlig hilsen / with kind regards
Steffen Tronstad
BroadPark Games drift/design
NextGenTel AS, part of TeliaSonera Group
Tlf: +47 466 988 46
Mail: sttr@nextgentel.com mailto:sttr@nextgentel.com
 please don’t print this e-mail unless you really need to.

-----Opprinnelig melding-----Fra: rt-users-bounces@lists.bestpractical.com [mailto:rt-users-bounces@lists.bestpractical.com] På vegne av Dominic Hargreaves
Sendt: 19. januar 2009 11:53
Til: rt-users@lists.bestpractical.com
Emne: Re: [rt-users] Programatically creating tickets with specific idnumbers

We’re in the process of migrating to RT from an ancient ticketing system.
I’d like to load our existing database of around 18,000 tickets into RT –
which seems eminently do-able using a bit of perl scripting. Except for
one thing: is it possible to set ticket ID numbers programatically? As
far as I can tell the ticket id is derived from an autoincrement value in
one of the DB tables and there’s no api for choosing a specific value.
Which makes it rather hard to preserve the existing ticket ID numbers.

If anyone can point me towards examples on the Net of code for doing this
sort of migration I’d be grateful.

You might find that there is inspiration to be drawn from
dumpfile-to-rt-3.0, part of RT::Extension::RT2toRT3 available on CPAN.

Dominic Hargreaves, Systems Development and Support Team
Computing Services, University of Oxford
http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users

Community help: http://wiki.bestpractical.com
Commercial support: sales@bestpractical.com

Discover RT’s hidden secrets with RT Essentials from O’Reilly Media.
Buy a copy at http://rtbook.bestpractical.com

Dominic Hargreaves wrote:> On Mon, Jan 19, 2009 at 10:22:16AM +0000, Matthew Seaman wrote:

If anyone can point me towards examples on the Net of code for doing this
sort of migration I’d be grateful.

You might find that there is inspiration to be drawn from
dumpfile-to-rt-3.0, part of RT::Extension::RT2toRT3 available on CPAN.

Excellent. That’s exactly what I need.

Thank you very much

Matthew

Dr Matthew Seaman The Bunker, Ash Radar Station
PGP: 0x60AE908C on servers Marshborough Rd
Tel: +44 1304 814890 Sandwich
Fax: +44 1304 814899 Kent, CT13 0PL, UK

signature.asc (259 Bytes)

Steffen Tronstad wrote:

You can just alter the table to start auto_increment from a higher number…
So that RT starts from 18001->

Very easy to do with phpMyAdmin

Yeah – I’ll need to do something like that after I’ve got all the legacy
stuff imported. We’ll probably start using RT live with ticket 20000 or
so, just so it’s obvious what came from where.

Cheers,

Matthew

Dr Matthew Seaman The Bunker, Ash Radar Station
PGP: 0x60AE908C on servers Marshborough Rd
Tel: +44 1304 814890 Sandwich
Fax: +44 1304 814899 Kent, CT13 0PL, UK

signature.asc (259 Bytes)