Page 1 of 1

Resetting tracking ID no back to zero

Posted: Thu Sep 11, 2025 2:39 pm
by chrisdevelop
Script URL:
Version of script: 343
Hosting company: caerta Hosting
URL of phpinfo.php:
URL of session_test.php:
What terms did you try when SEARCHING for a solution:

Write your message below:
I have to upgrade one of the sites to the latest, but how can i reset the 1st column called ID so it will start at No 1 when a new ticket is made. All existing tickets are being deleted so we need to go back to No 1 when a new ticket is made. Once all tickets are deleted if a new one is made it does not put 1 it puts 27 which was the last ticket generated.

Re: Resetting tracking ID no back to zero

Posted: Thu Sep 11, 2025 3:51 pm
by shddcit
chrisdevelop wrote: Thu Sep 11, 2025 2:39 pm Script URL:
Version of script: 343
Hosting company: caerta Hosting
URL of phpinfo.php:
URL of session_test.php:
What terms did you try when SEARCHING for a solution:

Write your message below:
I have to upgrade one of the sites to the latest, but how can i reset the 1st column called ID so it will start at No 1 when a new ticket is made. All existing tickets are being deleted so we need to go back to No 1 when a new ticket is made. Once all tickets are deleted if a new one is made it does not put 1 it puts 27 which was the last ticket generated.

If you are deleting all tickets, it's easier to delete the database itself, recreate it, and install HESK again.
However, if you want to keep all the previously created settings, then this (directly via SQL) is the only way.

If you need to reset the auto-increment in databases, use the following commands in your chosen database:

MySQL/MariaDB:

Code: Select all

ALTER TABLE table_name AUTO_INCREMENT = 1;
PostgreSQL:

Code: Select all

ALTER SEQUENCE table_name_id_seq RESTART WITH 1;
SQL Server:

Code: Select all

DBCC CHECKIDENT ('table_name', RESEED, 0);
SQLite:

Code: Select all

DELETE FROM sqlite_sequence WHERE name='table_name';

Re: Resetting tracking ID no back to zero

Posted: Thu Sep 11, 2025 6:01 pm
by Klemen
Just to add: if you have phpMyAdmin (most hosting companies provide it), you can open the hesk_tickets table, then on the "Operations" tab you can edit the "AUTO_INCREMENT" value to 1 and click "Go"