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
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?
Thanks in advance.
-Jess
Thanks in Advance.
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
How to delete ticket attachments by SQL query?
Thanks !
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;
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
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;