/
Support Tickets: Removing tickets older than 3 years
Support Tickets: Removing tickets older than 3 years
Using this procedure you can remove all tickets and their relationships for tickets that are older than 3 years (based on ticket creation date).
- Ensure to take full HostBill database backup before using this procedure
- You may want to keep mentioned sql backup somewhere safe, in case you'd need to find information from past
Run following SQL queries in single session on your HostBill database:
SET @ticket_ids := (SELECT GROUP_CONCAT(id) FROM hb_tickets WHERE status = 'Closed' AND date < DATE_SUB(NOW(),INTERVAL 3 YEAR)); DELETE FROM hb_ticket_replies WHERE FIND_IN_SET(ticket_id, @ticket_ids); DELETE FROM hb_ticket_rating WHERE FIND_IN_SET(ticket_id, @ticket_ids); DELETE FROM hb_ticket_billing_items WHERE FIND_IN_SET(ticket_id, @ticket_ids); DELETE FROM hb_ticket_subscriptions WHERE FIND_IN_SET(ticket_id, @ticket_ids); DELETE FROM hb_tickets_log WHERE FIND_IN_SET(ticket_id, @ticket_ids); DELETE FROM hb_tickets_notes WHERE FIND_IN_SET(ticket_id, @ticket_ids); DELETE FROM hb_tickets_public WHERE FIND_IN_SET(ticket_id, @ticket_ids); DELETE FROM hb_tickets_tags WHERE FIND_IN_SET(ticket_id, @ticket_ids); DELETE FROM hb_tickets_timers WHERE FIND_IN_SET(ticket_id, @ticket_ids); DELETE FROM hb_tickets_attachments WHERE FIND_IN_SET(ticket_id, @ticket_ids); DELETE FROM hb_tickets_emails WHERE rel='ticket' AND FIND_IN_SET(rel_id, @ticket_ids); DELETE FROM hb_tickets WHERE FIND_IN_SET(id, @ticket_ids);
, multiple selections available,
Related content
Ticket Departments - Notification
Ticket Departments - Notification
More like this
Ticket Departments - Other settings
Ticket Departments - Other settings
More like this
Support Fields
Support Fields
More like this
Creating and Managing Orders
Creating and Managing Orders
More like this
Support Settings
Support Settings
More like this
Migration from Hexonet to CentralNic Reseller module
Migration from Hexonet to CentralNic Reseller module
More like this