OTRS Support - Delete all tickets from database!


Right now I'm working a lot with OTRS for implementig MOPROSOFT and ISO 20K Proccesses within OTRS, for my actual employer. I did a lot of tests of the configuration and the workflow of the process inside the tool (OTRS) but at the end in the system there was a lot of tickets that were created meanwhile I'm doing the test, so I need to find way for clean up my OTRS instalation, so I check on the internet o hopefully I can find a solution, personally I use the second option, "Delete the entires from the following tables via SQL", because I wanna delete all the tickets from my system, I tried this option and I must say, really works well. If you need clean up your OTRS systems this is one of the best options.

greetings

Roberto García


Solution Problem: . You want to cleanup/delete all tickets from the database but you don't want to delete the agents, queues and other settings. Solucion: You have two options to do this. 

a) Use the GenericAgent in the Admin-Interface to create an job to delete your selected tickets. 

b) Delete the entries from the following tables via SQL:
delete from ticket_history;

delete from article;

delete from article_attachment;

delete from article_plain;

delete from time_accounting;

delete from ticket;


After that you will have no more tickets in your system.

Note: This querys run under Mysql... I don't know if they run in another DB

Comentarios

Anónimo ha dicho que…
TRUE BLOOD! Thanks, your article saved me hours of problems with triggering deletation with Agent if there are more than 200k tickets in DB..
Writer ha dicho que…
Hi,

I get an error when trying to delete records from the article table and the ticket table. It looks like this

Cannot delete or update a parent row: a foreign key constraint fails (`otrs`.`article_flag`, CONSTRAINT `FK_article_flag_article_id_id` FOREIGN KEY (`article_id`) REFERENCES `article` (`id`)), SQL: 'delete from article;'

any idea How I can clean the table?
tristan ha dicho que…
Hi Sir, May I ask where's the location of All Created Tickets database..

Thanks in advance.

-Jess

tristan ha dicho que…
Hi Sir, May I ask where can I find the location of All Created Ticket Database. Thanks in Advance.
tristan ha dicho que…
Hi Sir, May I ask where's the database location of All Ticket Created in OTRS.

Thanks in Advance.
Robert ha dicho que…
Hi Tristan, the location in the database is the table named "ticket", here is where you can find all your tickets created via email or via telephone ticket or whatever.


Robert ha dicho que…
Hi!, Laahiru Bandaranayake, sorry but I didn´t see your comment, maybe is foreign key issue, so you need to see an Entity–relationship diagram from the OTRS database for check the relationships, here is a link to the diagram

It's something old, is for the OTRS version 2.3, but maybe can help you.

http://ftp.otrs.org/pub/otrs/misc/otrs-2.3-database.png


And here is a link for a common problem with foreign keys in MySQL DB:

http://stackoverflow.com/questions/3334619/cannot-delete-or-update-a-parent-row-a-foreign-key-constraint-fails
Anónimo ha dicho que…
Great article. I liked second option. Its much better and faster.

How to delete ticket attachments by SQL query?

Thanks !
Luciano ha dicho que…
delete from ticket_history;
delete from article_plain;
delete from article_attachment;
delete from time_accounting;
delete from article_flag;
delete from article;
delete from ps_ticketchecklist;
delete from ticket;
Unknown ha dicho que…
The Information you provided is very much useful for who take OTRS Support. This Information was very Interesting.

Once Please Visit Our OTRS Support Blog also. Thank u

Our Blog: http://otrssupport.blogspot.in/
Please Contact Us : - 040-65544477/49510533
Email : - Kiran_Koovuri@testtriangle.com
Our Website :- http://www.testtriangle.com/
URL :- http://www.testtriangle.com/otrs-consultancy
Alexander Vinson ha dicho que…
Adding the ticket_flag was necessary in my database. The ps_ticketchecklist I copied from Luciano Above... Hope it helps


delete from ticket_history;
delete from article_plain;
delete from article_attachment;
delete from time_accounting;
delete from article_flag;
delete from article;
delete from ps_ticketchecklist;
delete from ticket_flag;
delete from ticket;

Entradas populares