[SOLVED] Reset ticket id

Moderator: crythias

Post Reply
zip
Znuny advanced
Posts: 103
Joined: 02 Jan 2014, 12:32
Znuny Version: 5.0.9

[SOLVED] Reset ticket id

Post by zip »

Hello,

if i delete all tickets and then create a new one the id does not start again from 1. It's possible to reset the id somehow?
ticketid.png
You do not have the required permissions to view the files attached to this post.
Last edited by zip on 03 Aug 2016, 14:07, edited 1 time in total.
OTRS 5.0.9 - CentOS 7 - MariaDB 5.5
Eggllo
Znuny newbie
Posts: 79
Joined: 09 Jun 2016, 14:27
Znuny Version: 5.0.10

Re: Reset ticket id

Post by Eggllo »

You could try checking out TicketCounter.log, but you might have to do some extra config in Config.pm...

Check out this article from one of the mailing lists:
http://otrs.otrs.narkive.com/7vaZnHDC/i ... the-config
<OTRS_HOME>/var/log/TicketCounter.log is the last ticket allocated.
Which you need to set 0 for next ticket to be 1 ;)
I haven't tested this myself, but I have also seen quite a few people saying you might run into some issues if you try to do this the wrong way so I would make sure to test this thoroughly beforehand...
OTRS v5.0.10 with ITSM extension.
MySQL database
Ubuntu 16.04 LTS
jojo
Znuny guru
Posts: 15019
Joined: 26 Jan 2007, 14:50
Znuny Version: Git Master
Contact:

Re: Reset ticket id

Post by jojo »

as the ticket ID is only used intern there is no need to reset it. The Ticket# is the one used to the outside world...
"Production": OTRS™ 8, OTRS™ 7, STORM powered by OTRS
"Testing": ((OTRS Community Edition)) and git Master

Never change Defaults.pm! :: Blog
Professional Services:: http://www.otrs.com :: enjoy@otrs.com
zip
Znuny advanced
Posts: 103
Joined: 02 Jan 2014, 12:32
Znuny Version: 5.0.9

Re: Reset ticket id

Post by zip »

Eggllo wrote:You could try checking out TicketCounter.log, but you might have to do some extra config in Config.pm...

Check out this article from one of the mailing lists:
http://otrs.otrs.narkive.com/7vaZnHDC/i ... the-config
<OTRS_HOME>/var/log/TicketCounter.log is the last ticket allocated.
Which you need to set 0 for next ticket to be 1 ;)
I haven't tested this myself, but I have also seen quite a few people saying you might run into some issues if you try to do this the wrong way so I would make sure to test this thoroughly beforehand...
thanks but this affects the ticket number and not the ticket id
OTRS 5.0.9 - CentOS 7 - MariaDB 5.5
Eggllo
Znuny newbie
Posts: 79
Joined: 09 Jun 2016, 14:27
Znuny Version: 5.0.10

Re: Reset ticket id

Post by Eggllo »

Why would you want to change the ID? I'd have to agree with jojo here.
OTRS v5.0.10 with ITSM extension.
MySQL database
Ubuntu 16.04 LTS
crythias
Moderator
Posts: 10169
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: Reset ticket id

Post by crythias »

DISCLAIMER: The following is not recommended, may not work, depends on multiple variables, but in general:
Your data is your responsibility.
Make and verify backups.

http://stackoverflow.com/questions/8923 ... t-in-mysql
Summary:
DO NOT DO THIS
you shouldn't ever need to do it.
If you need to do it, you can either use an ALTER TABLE or recreate the table.

Why not do this? If there are any Articles or other entries that rely on a previously used index *anywhere*, they will now be attached to the reused ticket ID.

If you want to start your numbering of IDs over, it is likely best to build a new database.
OTRS 6.0.x (private/testing/public) on Linux with MySQL database.
Please edit your signature to include your OTRS version, Operating System, and database type.
Click Subscribe Topic below to get notifications. Consider amending your topic title to include [SOLVED] if it is so.
Need help? Before you ask
zip
Znuny advanced
Posts: 103
Joined: 02 Jan 2014, 12:32
Znuny Version: 5.0.9

Re: Reset ticket id

Post by zip »

thanks crythias, it's working fine.

I am migrating tickets and i made some tests and i thougt i had to set the id to 1 before i do so. But now i still get this error if i want to open some of the migrated tickets:
otrs_noperm.png
You do not have the required permissions to view the files attached to this post.
OTRS 5.0.9 - CentOS 7 - MariaDB 5.5
jojo
Znuny guru
Posts: 15019
Joined: 26 Jan 2007, 14:50
Znuny Version: Git Master
Contact:

Re: Reset ticket id

Post by jojo »

If you want to migrate you need the Full database and to follow the documentation.

You can not insert ticket directly in the database. You should never write directly to the database
"Production": OTRS™ 8, OTRS™ 7, STORM powered by OTRS
"Testing": ((OTRS Community Edition)) and git Master

Never change Defaults.pm! :: Blog
Professional Services:: http://www.otrs.com :: enjoy@otrs.com
zip
Znuny advanced
Posts: 103
Joined: 02 Jan 2014, 12:32
Znuny Version: 5.0.9

Re: Reset ticket id

Post by zip »

ok thanks for your help!
OTRS 5.0.9 - CentOS 7 - MariaDB 5.5
Post Reply