RT – starting from a ticket number larger than 1

Ok, so not a request you would get every day, but when setting up our new RT (Request Tracker) server, we had a requirement to start at ticket number 200,000. This requirement was to ensure the new RT server’s tickets did not overlap with the old server. We have some great new features with the version 4 and we have also installed the SLA add on – all very exciting! Anyway, how is this change made?

The first thing you need to know is there is no convenient, easy to use button to click or setting to make in the config file. This needs to be done on the database direct, in my case this is a MySQL database, but it could be any of the supported database types. From the command line, log into the MySQL console and navigate to the rt4 database:

# mysql -u root -p
Enter password: 
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 108
Server version: 5.5.30 Source distribution

Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> use rt4
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
mysql> show tables;
+-------------------------+
| Tables_in_rt4           |
+-------------------------+
| ACL                     |
| Articles                |
| Attachments             |
| Attributes              |
| CachedGroupMembers      |
| Classes                 |
| CustomFieldValues       |
| CustomFields            |
| GroupMembers            |
| Groups                  |
| Links                   |
| ObjectClasses           |
| ObjectCustomFieldValues |
| ObjectCustomFields      |
| ObjectTopics            |
| Principals              |
| Queues                  |
| ScripActions            |
| ScripConditions         |
| Scrips                  |
| Templates               |
| Tickets                 |
| Topics                  |
| Transactions            |
| Users                   |
| sessions                |
+-------------------------+
26 rows in set (0.00 sec)

mysql> 

So we can see the tables and the one that interests us is the Tickets table. We need to alter the auto increment setting to start at 200000 from here:

mysql> ALTER TABLE Tickets AUTO_INCREMENT = 200000;

Job done!
 

This entry was posted in FreeBSD Administration, MySQL and tagged , . Bookmark the permalink.

Leave a Reply