Altering ticket id # - Help!

I’ve rebuilt our RT onto a new platform with better queues etc… but I
want to reset the Ticket Id to be something like 10000+ so it doesn’t
clash with old-rt tickets.

Can someone point me in the right direction? im checking the Wiki stuff
now, but can’t find anything.

Thanks!

Adrian Carter
Network Engineer
Leading Edge Internet
Direct +61 2 6163 6162 Support 1 300 662 415
E-mail cartera@lei.net.au

I’ve rebuilt our RT onto a new platform with better queues etc… but I
want to reset the Ticket Id to be something like 10000+ so it doesn’t
clash with old-rt tickets.

The ticket numbers comes from the incrementing sequence in the
database. Instructions on changing it was once sent to the list, but I
don’t have a pointer handy. (It shouldn’t be that hard if you have
sufficient SQL knowledge)

seph

Thanks Seph,
I figured it was something like this… but I’ve tried altering the
“Tickets” table and “Transactions” to reflect a ticket number of say
10000, thinking the next one would be 10001.

Doesn't work :( . Next ticket goes back to next in the sequence.. 

The tickets all work once doctored up to 10000, but new tickets go back
to 5,6,7 etc.

Im pretty good with SQL but this ones got me scratchin my head. 

Guess Illl have to go debug the CreateTicket function.

Adrian

seph wrote:

I’ve rebuilt our RT onto a new platform with better queues etc… but I
want to reset the Ticket Id to be something like 10000+ so it doesn’t
clash with old-rt tickets.

The ticket numbers comes from the incrementing sequence in the
database. Instructions on changing it was once sent to the list, but I
don’t have a pointer handy. (It shouldn’t be that hard if you have
sufficient SQL knowledge)

seph


The rt-users Archives

Be sure to check out the RT wiki at http://wiki.bestpractical.com

Adrian Carter
Network Engineer
Leading Edge Internet
Direct +61 2 6163 6162 Support 1 300 662 415
E-mail cartera@lei.net.au

  • cartera@lei.net.au (Adrian Carter) [Wed 17 Nov 2004, 17:18 CET]:

I’ve rebuilt our RT onto a new platform with better queues etc… but I
want to reset the Ticket Id to be something like 10000+ so it doesn’t
clash with old-rt tickets.

Can someone point me in the right direction? im checking the Wiki stuff
now, but can’t find anything.

What database do you use?

For PostgreSQL, connect to the RT database and issue this a few
gazillion times:

select nextval (‘tickets_id_seq’);

For MySQL, you can set the sequence number to arbitrary values; I’ve
only used phpMyAdmin to do so.

-- Niels.

Got it all solved - You need to add an entry via an insert not just
update an existing one.

Adding one with the new seed ticket and then deleting it changed the id
to 10001.

Thanks!

Niels Bakker wrote:

  • cartera@lei.net.au (Adrian Carter) [Wed 17 Nov 2004, 17:18 CET]:

I’ve rebuilt our RT onto a new platform with better queues etc… but I
want to reset the Ticket Id to be something like 10000+ so it doesn’t
clash with old-rt tickets.

Can someone point me in the right direction? im checking the Wiki stuff
now, but can’t find anything.

What database do you use?

For PostgreSQL, connect to the RT database and issue this a few
gazillion times:

select nextval (‘tickets_id_seq’);

For MySQL, you can set the sequence number to arbitrary values; I’ve
only used phpMyAdmin to do so.

– Niels.

Adrian Carter
Network Engineer
Leading Edge Internet
Direct +61 2 6163 6162 Support 1 300 662 415
E-mail cartera@lei.net.au

For MySQL

ALTER TABLE tbl_name AUTO_INCREMENT = value;

is right thing to do.
Regards. Ruslan.

Adrian Carter wrote:

I figured it was something like this.. but I've tried altering the

“Tickets” table and “Transactions” to reflect a ticket number of say
10000, thinking the next one would be 10001.

Doesn't work :( . Next ticket goes back to next in the

sequence… The tickets all work once doctored up to 10000, but new
tickets go back to 5,6,7 etc.

Im pretty good with SQL but this ones got me scratchin my

head. Guess Illl have to go debug the CreateTicket function.

no, I’m pretty sure you want to modify the sql sequence not the
existing table or CreateTicket.

seph