Resetting ticket numbers

Is it possible to reset the tickets back to zero? We’re finished with
our testing and want to go live but it would be good to erase all the
test tickets first. Deleting them still holds them in the data base with
the counter leaving off with the last ticket number. Truncating the
ticket table in mysql (Linux) brought me back to zero but all new
tickets include the original data in the history view. For example,
ticket number 1 shows what transpired in the original ticket #1. I hope
I’m not asking a question that’s already been answered. I’ve searched
the archives and only found one incident of this question which went
unanswered. Any help would be appreciated.

Thanks,

Joe

I have a related question to this one…
Is it possible to change the starting ticket number? The boss would
like the ticket numbers to be something like 1001, 1002, 1003… instead
of 1,2,3…

Thanks,
Jason

Walmach, Joe wrote:

Thanks Frank… I will give that a try!!

Jason

Frank Pater wrote:

Hi Jason,

I was able to do this for my Postgres-based RT installation with the following SQL:

select setval(‘tickets_id_seq’, );

I’m sure there is similar code that works for MySQL.

FrankOn Fri, Nov 18, 2005 at 10:11:31AM -0500, Jason Bachman wrote:

I have a related question to this one…
Is it possible to change the starting ticket number? The boss would like
the ticket numbers to be something like 1001, 1002, 1003… instead of
1,2,3…

Thanks,
Jason

Walmach, Joe wrote:

 Is it possible to reset the tickets back to zero? We're finished with
 our testing and want to go live but it would be good to erase all the
 test tickets first. Deleting them still holds them in the data base with
 the counter leaving off with the last ticket number. Truncating the
 ticket table in mysql (Linux) brought me back to zero but all new
 tickets include the original data in the history view. For example,
 ticket number 1 shows what transpired in the original ticket #1. I hope
 I'm not asking a question that's already been answered. I've searched
 the archives and only found one incident of this question which went
 unanswered. Any help would be appreciated.

 

 Thanks,

 

 Joe

   ------------------------------------------------------------------

[1]The rt-users Archives

Be sure to check out the RT Wiki at [2]http://wiki.bestpractical.com

Download a free sample chapter of RT Essentials from O’Reilly Media at [3]http://rtbook.bestpractical.com

WE’RE COMING TO YOUR TOWN SOON - RT Training in Amsterdam, Boston and
San Francisco - Find out more at [4]http://bestpractical.com/services/training.html

References

Visible links

  1. The rt-users Archives
  2. http://wiki.bestpractical.com/
  3. http://rtbook.bestpractical.com/
  4. http://bestpractical.com/services/training.html

The rt-users Archives

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

Download a free sample chapter of RT Essentials from O’Reilly Media at http://rtbook.bestpractical.com

WE’RE COMING TO YOUR TOWN SOON - RT Training in Amsterdam, Boston and
San Francisco - Find out more at http://bestpractical.com/services/training.html
Frank Pater
DCANet
http://www.dca.net
voice: 888-4-DCANET (888-432-2638)
fax: 302-426-6386

I think the easiest way would be to drop and re-initialize the
database. Unless you did a bunch of custom scrips, templates, etc.

Jason Bachman wrote:

Thanks Frank… I will give that a try!!

Jason

Frank Pater wrote:

Hi Jason,

I was able to do this for my Postgres-based RT installation with the following SQL:

select setval(‘tickets_id_seq’, );

I’m sure there is similar code that works for MySQL.

Frank

I have a related question to this one…
Is it possible to change the starting ticket number? The boss would like
the ticket numbers to be something like 1001, 1002, 1003… instead of
1,2,3…

Thanks,
Jason

Walmach, Joe wrote:

 Is it possible to reset the tickets back to zero? We're finished with
 our testing and want to go live but it would be good to erase all the
 test tickets first. Deleting them still holds them in the data base with
 the counter leaving off with the last ticket number. Truncating the
 ticket table in mysql (Linux) brought me back to zero but all new
 tickets include the original data in the history view. For example,
 ticket number 1 shows what transpired in the original ticket #1. I hope
 I'm not asking a question that's already been answered. I've searched
 the archives and only found one incident of this question which went
 unanswered. Any help would be appreciated.

 

 Thanks,

 

 Joe

   ------------------------------------------------------------------

[1]The rt-users Archives

Be sure to check out the RT Wiki at [2]http://wiki.bestpractical.com

Download a free sample chapter of RT Essentials from O’Reilly Media at [3]http://rtbook.bestpractical.com

WE’RE COMING TO YOUR TOWN SOON - RT Training in Amsterdam, Boston and
San Francisco - Find out more at [4]http://bestpractical.com/services/training.html

References

Visible links

  1. The rt-users Archives
  2. http://wiki.bestpractical.com/
  3. http://rtbook.bestpractical.com/
  4. http://bestpractical.com/services/training.html

The rt-users Archives

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

Download a free sample chapter of RT Essentials from O’Reilly Media at http://rtbook.bestpractical.com

WE’RE COMING TO YOUR TOWN SOON - RT Training in Amsterdam, Boston and
San Francisco - Find out more at http://bestpractical.com/services/training.html

Frank Pater
DCANet
http://www.dca.net
voice: 888-4-DCANET (888-432-2638)
fax: 302-426-6386



The rt-users Archives

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

Download a free sample chapter of RT Essentials from O’Reilly Media at http://rtbook.bestpractical.com

WE’RE COMING TO YOUR TOWN SOON - RT Training in Amsterdam, Boston and
San Francisco - Find out more at http://bestpractical.com/services/training.html

Drew Barnes
Applications Analyst
Raymond Walters College
University of Cincinnati

I did an “ALTER TABLE Tickets auto_increment=1000;” and it worked just
fine. All new tickets are in the 1000’s now.

Thanks Frank and Joe!
Jason

Drew Barnes wrote:

I’m glad that worked for you Jason, now I won’t be so nervous when I do
it next week. :slight_smile: I suppose ALTER TABLE Tickets auto_increment=0001;
would work also but you’d be back to “0” after 9999?

Take care,

JoeFrom: rt-users-bounces@lists.bestpractical.com
[mailto:rt-users-bounces@lists.bestpractical.com] On Behalf Of Jason
Bachman
Sent: Friday, November 18, 2005 11:23 AM
To: rt-users@lists.bestpractical.com
Subject: Re: [rt-users] resetting ticket numbers

I did an “ALTER TABLE Tickets auto_increment=1000;” and it worked just
fine. All new tickets are in the 1000’s now.

Thanks Frank and Joe!
Jason

Drew Barnes wrote:

I think the easiest way would be to drop and re-initialize the
database. Unless you did a bunch of custom scrips, templates, etc.

Jason Bachman wrote:

Thanks Frank… I will give that a try!!

Jason

Frank Pater wrote:

Hi Jason,

I was able to do this for my Postgres-based RT installation with

the following SQL:

select setval(‘tickets_id_seq’, );

I’m sure there is similar code that works for MySQL.

Frank

I have a related question to this one…
Is it possible to change the starting ticket number? The boss
would like
the ticket numbers to be something like 1001, 1002, 1003…
instead of
1,2,3…

Thanks,
Jason

Walmach, Joe wrote:

 Is it possible to reset the tickets back to zero? We're 

finished with
our testing and want to go live but it would be good to erase
all the
test tickets first. Deleting them still holds them in the data

base with
the counter leaving off with the last ticket number.
Truncating the
ticket table in mysql (Linux) brought me back to zero but all
new
tickets include the original data in the history view. For
example,
ticket number 1 shows what transpired in the original ticket
#1. I hope
I’m not asking a question that’s already been answered. I’ve
searched
the archives and only found one incident of this question
which went
unanswered. Any help would be appreciated.

 Thanks,


 Joe


[1]The rt-users Archives

Be sure to check out the RT Wiki at
[2]http://wiki.bestpractical.com

Download a free sample chapter of RT Essentials from O’Reilly
Media at [3]http://rtbook.bestpractical.com

WE’RE COMING TO YOUR TOWN SOON - RT Training in Amsterdam, Boston
and
San Francisco - Find out more at
[4]http://bestpractical.com/services/training.html

References

Visible links
1.
The rt-users Archives
2. http://wiki.bestpractical.com/
3. http://rtbook.bestpractical.com/
4. http://bestpractical.com/services/training.html


The rt-users Archives

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

Download a free sample chapter of RT Essentials from O’Reilly Media

at http://rtbook.bestpractical.com

WE’RE COMING TO YOUR TOWN SOON - RT Training in Amsterdam, Boston
and
San Francisco - Find out more at
http://bestpractical.com/services/training.html

Frank Pater
DCANet
http://www.dca.net
voice: 888-4-DCANET (888-432-2638)
fax: 302-426-6386


The rt-users Archives

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

Download a free sample chapter of RT Essentials from O’Reilly Media
at http://rtbook.bestpractical.com

WE’RE COMING TO YOUR TOWN SOON - RT Training in Amsterdam, Boston and
San Francisco - Find out more at
http://bestpractical.com/services/training.html

http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users

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

Download a free sample chapter of RT Essentials from O’Reilly Media at
http://rtbook.bestpractical.com

WE’RE COMING TO YOUR TOWN SOON - RT Training in Amsterdam, Boston and
San Francisco - Find out more at
http://bestpractical.com/services/training.html

In addition to the other replies on this subject I’m going to include an
answer to my original question which I just implemented.

On my Linux sever running mysql I did the following:

After backing up the data base I logged into mysql and switched to my rt
database.

I then ran:

TRUNCATE TABLE Tickets ;

And then

TRUNCATE TABLE Transactions ;

I then restarted mysql

This emptied the Tickets table and all historical data on those same
tickets that resided in the Transactions table. I now am back to ticket
number 1 without the history of the previous tickets showing up. In
addition I didn’t have to disrupt my queues, users, scrips, etc. I hope
this is of value to someone.

JoeFrom: rt-users-bounces@lists.bestpractical.com
[mailto:rt-users-bounces@lists.bestpractical.com] On Behalf Of Walmach,
Joe
Sent: Friday, November 18, 2005 9:35 AM
To: rt-users@lists.bestpractical.com
Subject: [rt-users] resetting ticket numbers

Is it possible to reset the tickets back to zero? We’re finished with
our testing and want to go live but it would be good to erase all the
test tickets first. Deleting them still holds them in the data base with
the counter leaving off with the last ticket number. Truncating the
ticket table in mysql (Linux) brought me back to zero but all new
tickets include the original data in the history view. For example,
ticket number 1 shows what transpired in the original ticket #1. I hope
I’m not asking a question that’s already been answered. I’ve searched
the archives and only found one incident of this question which went
unanswered. Any help would be appreciated.

Thanks,

Joe

described situation in the MySQL, please clarify Pg and Oracle info:
Request Tracker Wiki 11/18/05, Walmach, Joe joe.walmach@intel.com wrote:

I’m glad that worked for you Jason, now I won’t be so nervous when I do
it next week. :slight_smile: I suppose ALTER TABLE Tickets auto_increment=0001;
would work also but you’d be back to “0” after 9999?

Take care,

Joe

-----Original Message-----
From: rt-users-bounces@lists.bestpractical.com
[mailto:rt-users-bounces@lists.bestpractical.com] On Behalf Of Jason
Bachman
Sent: Friday, November 18, 2005 11:23 AM
To: rt-users@lists.bestpractical.com
Subject: Re: [rt-users] resetting ticket numbers

I did an “ALTER TABLE Tickets auto_increment=1000;” and it worked just
fine. All new tickets are in the 1000’s now.

Thanks Frank and Joe!
Jason

Drew Barnes wrote:

I think the easiest way would be to drop and re-initialize the
database. Unless you did a bunch of custom scrips, templates, etc.

Jason Bachman wrote:

Thanks Frank… I will give that a try!!

Jason

Frank Pater wrote:

Hi Jason,

I was able to do this for my Postgres-based RT installation with

the following SQL:

select setval(‘tickets_id_seq’, );

I’m sure there is similar code that works for MySQL.

Frank

On Fri, Nov 18, 2005 at 10:11:31AM -0500, Jason Bachman wrote:

I have a related question to this one…
Is it possible to change the starting ticket number? The boss
would like
the ticket numbers to be something like 1001, 1002, 1003…
instead of
1,2,3…

Thanks,
Jason

Walmach, Joe wrote:

 Is it possible to reset the tickets back to zero? We're

finished with
our testing and want to go live but it would be good to erase
all the
test tickets first. Deleting them still holds them in the data

base with
the counter leaving off with the last ticket number.
Truncating the
ticket table in mysql (Linux) brought me back to zero but all
new
tickets include the original data in the history view. For
example,
ticket number 1 shows what transpired in the original ticket
#1. I hope
I’m not asking a question that’s already been answered. I’ve
searched
the archives and only found one incident of this question
which went
unanswered. Any help would be appreciated.

 Thanks,


 Joe


[1]The rt-users Archives

Be sure to check out the RT Wiki at
[2]http://wiki.bestpractical.com

Download a free sample chapter of RT Essentials from O’Reilly
Media at [3]http://rtbook.bestpractical.com

WE’RE COMING TO YOUR TOWN SOON - RT Training in Amsterdam, Boston
and
San Francisco - Find out more at
[4]http://bestpractical.com/services/training.html

References

Visible links
1.
The rt-users Archives
2. http://wiki.bestpractical.com/
3. http://rtbook.bestpractical.com/
4. http://bestpractical.com/services/training.html


The rt-users Archives

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

Download a free sample chapter of RT Essentials from O’Reilly Media

at http://rtbook.bestpractical.com

WE’RE COMING TO YOUR TOWN SOON - RT Training in Amsterdam, Boston
and
San Francisco - Find out more at
http://bestpractical.com/services/training.html

Frank Pater
DCANet
http://www.dca.net
voice: 888-4-DCANET (888-432-2638)
fax: 302-426-6386



The rt-users Archives

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

Download a free sample chapter of RT Essentials from O’Reilly Media
at http://rtbook.bestpractical.com

WE’RE COMING TO YOUR TOWN SOON - RT Training in Amsterdam, Boston and
San Francisco - Find out more at
http://bestpractical.com/services/training.html


The rt-users Archives

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

Download a free sample chapter of RT Essentials from O’Reilly Media at
http://rtbook.bestpractical.com

WE’RE COMING TO YOUR TOWN SOON - RT Training in Amsterdam, Boston and
San Francisco - Find out more at
http://bestpractical.com/services/training.html


The rt-users Archives

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

Download a free sample chapter of RT Essentials from O’Reilly Media at http://rtbook.bestpractical.com

WE’RE COMING TO YOUR TOWN SOON - RT Training in Amsterdam, Boston and
San Francisco - Find out more at http://bestpractical.com/services/training.html

Best regards, Ruslan.

For PostgreSQL, the following query will set the next ticket
number:

SELECT setval(‘tickets_id_seq’,,false);

I do not know for Oracle.From: Ruslan Zakirov [mailto:ruslan.zakirov@gmail.com]
Sent: Friday, November 18, 2005 1:35 PM
To: Walmach, Joe
Cc: Jason Bachman; rt-users@lists.bestpractical.com
Subject: Re: [rt-users] resetting ticket numbers

described situation in the MySQL, please clarify Pg and Oracle info:
http://wiki.bestpractical.com/index.cgi?SetStartingId

I’m glad that worked for you Jason, now I won’t be so nervous when I
do
it next week. :slight_smile: I suppose ALTER TABLE Tickets auto_increment=0001;
would work also but you’d be back to “0” after 9999?

Take care,

Joe

-----Original Message-----
From: rt-users-bounces@lists.bestpractical.com
[mailto:rt-users-bounces@lists.bestpractical.com] On Behalf Of Jason
Bachman
Sent: Friday, November 18, 2005 11:23 AM
To: rt-users@lists.bestpractical.com
Subject: Re: [rt-users] resetting ticket numbers

I did an “ALTER TABLE Tickets auto_increment=1000;” and it worked just
fine. All new tickets are in the 1000’s now.

Thanks Frank and Joe!
Jason

Drew Barnes wrote:

I think the easiest way would be to drop and re-initialize the
database. Unless you did a bunch of custom scrips, templates, etc.

Jason Bachman wrote:

Thanks Frank… I will give that a try!!

Jason

Frank Pater wrote:

Hi Jason,

I was able to do this for my Postgres-based RT installation

with

the following SQL:

select setval(‘tickets_id_seq’, );

I’m sure there is similar code that works for MySQL.

Frank

I have a related question to this one…
Is it possible to change the starting ticket number? The boss
would like
the ticket numbers to be something like 1001, 1002, 1003…
instead of
1,2,3…

Thanks,
Jason

Walmach, Joe wrote:

 Is it possible to reset the tickets back to zero? We're

finished with
our testing and want to go live but it would be good to
erase
all the
test tickets first. Deleting them still holds them in the
data

base with
the counter leaving off with the last ticket number.
Truncating the
ticket table in mysql (Linux) brought me back to zero but
all
new
tickets include the original data in the history view. For
example,
ticket number 1 shows what transpired in the original ticket
#1. I hope
I’m not asking a question that’s already been answered. I’ve
searched
the archives and only found one incident of this question
which went
unanswered. Any help would be appreciated.

 Thanks,


 Joe

[1]The rt-users Archives

Be sure to check out the RT Wiki at
[2]http://wiki.bestpractical.com

Download a free sample chapter of RT Essentials from O’Reilly
Media at [3]http://rtbook.bestpractical.com

WE’RE COMING TO YOUR TOWN SOON - RT Training in Amsterdam,
Boston
and
San Francisco - Find out more at
[4]http://bestpractical.com/services/training.html

References

Visible links
1.
The rt-users Archives
2. http://wiki.bestpractical.com/
3. http://rtbook.bestpractical.com/
4. http://bestpractical.com/services/training.html


The rt-users Archives

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

Download a free sample chapter of RT Essentials from O’Reilly
Media

at http://rtbook.bestpractical.com

WE’RE COMING TO YOUR TOWN SOON - RT Training in Amsterdam, Boston
and
San Francisco - Find out more at
http://bestpractical.com/services/training.html

Frank Pater
DCANet
http://www.dca.net
voice: 888-4-DCANET (888-432-2638)
fax: 302-426-6386


The rt-users Archives

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

Download a free sample chapter of RT Essentials from O’Reilly Media
at http://rtbook.bestpractical.com

WE’RE COMING TO YOUR TOWN SOON - RT Training in Amsterdam, Boston
and
San Francisco - Find out more at
http://bestpractical.com/services/training.html


The rt-users Archives

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

Download a free sample chapter of RT Essentials from O’Reilly Media at
http://rtbook.bestpractical.com

WE’RE COMING TO YOUR TOWN SOON - RT Training in Amsterdam, Boston and
San Francisco - Find out more at
http://bestpractical.com/services/training.html


The rt-users Archives

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

Download a free sample chapter of RT Essentials from O’Reilly Media at
http://rtbook.bestpractical.com

WE’RE COMING TO YOUR TOWN SOON - RT Training in Amsterdam, Boston and
San Francisco - Find out more at
http://bestpractical.com/services/training.html

Best regards, Ruslan.

Very bad solution! Most probably you’ll hit bugs in the future.
Tickets and transactions are not all the objects you have to delete if
you want to get rid of the tickets.
If you don’t have backup then I’ll suggest you to start from scratch.
If you have backup then restore it and just mark all old tickets as
deleted, or use RTx::Shredder to delete them from DB.On 11/18/05, Walmach, Joe joe.walmach@intel.com wrote:

In addition to the other replies on this subject I’m going to include an
answer to my original question which I just implemented.

On my Linux sever running mysql I did the following:

After backing up the data base I logged into mysql and switched to my rt
database.

I then ran:

TRUNCATE TABLE Tickets ;

And then

TRUNCATE TABLE Transactions ;

I then restarted mysql

This emptied the Tickets table and all historical data on those same tickets
that resided in the Transactions table. I now am back to ticket number 1
without the history of the previous tickets showing up. In addition I didn’t
have to disrupt my queues, users, scrips, etc. I hope this is of value to
someone.

Joe


From: rt-users-bounces@lists.bestpractical.com
[mailto:rt-users-bounces@lists.bestpractical.com] On Behalf
Of Walmach, Joe
Sent: Friday, November 18, 2005 9:35 AM
To: rt-users@lists.bestpractical.com
Subject: [rt-users] resetting ticket numbers

Is it possible to reset the tickets back to zero? We’re finished with our
testing and want to go live but it would be good to erase all the test
tickets first. Deleting them still holds them in the data base with the
counter leaving off with the last ticket number. Truncating the ticket table
in mysql (Linux) brought me back to zero but all new tickets include the
original data in the history view. For example, ticket number 1 shows what
transpired in the original ticket #1. I hope I’m not asking a question
that’s already been answered. I’ve searched the archives and only found one
incident of this question which went unanswered. Any help would be
appreciated.

Thanks,

Joe


The rt-users Archives

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

Download a free sample chapter of RT Essentials from O’Reilly Media at
http://rtbook.bestpractical.com

WE’RE COMING TO YOUR TOWN SOON - RT Training in Amsterdam, Boston and
San Francisco - Find out more at
http://bestpractical.com/services/training.html

Best regards, Ruslan.

At Friday 11/18/2005 01:11 PM, Walmach, Joe wrote:

Content-class: urn:content-classes:message
Content-Type: multipart/alternative;
boundary=“----_=_NextPart_001_01C5EC6B.939CDFEE”

In addition to the other replies on this subject Im going to include an
answer to my original question which I just implemented.

On my Linux sever running mysql I did the following:

After backing up the data base I logged into mysql and switched to my rt
database.

I then ran:

TRUNCATE TABLE Tickets ;

And then

TRUNCATE TABLE Transactions ;

I then restarted mysql

This emptied the Tickets table and all historical data on those same
tickets that resided in the Transactions table. I now am back to ticket
number 1 without the history of the previous tickets showing up. In
addition I didnt have to disrupt my queues, users, scrips, etc. I hope
this is of value to someone.

Joe

Joe,

As stated before this is a really bad idea - your database has now lost
data integrity. It’s not a good idea to truncate tables without
understanding the ramifications. The above approach cannot be of value to
anyone - please be sure you know the subject matter before posting advice
for others. I’m sorry if this sounds rude, but I’d hate to think of someone
reading this, thinking that it was an OK solution, and ruining their database.

Steve

Joe,

Thanks for the note - I actually regret sending off the mail on Saturday, I
wasn’t in a great frame of mind and I was a bit hasty, so my apologies to you.

That said, the RT database has many relationships that aren’t obvious and
may come back to haunt you. For example, when a new ticket is created new
groups are also created to keep track of requestors, access control etc.
It’s possible that your new tickets may have incorrect requestors listed as
a result.

Good luck,
Steve

At Monday 11/21/2005 12:48 PM, you wrote: