I was looking for a friendly solution to a problem of a client of mine, who requested the update osTicket osTicket 1.2 to 1.6, and to my astonishment, after much searching in various fora, including the developers own site, I realized that there was a direct way to do this update.
I had to solve the problem, then I opened my MySQL Workbench and did the reverse engineering of the best tables to view them. After many selects, inserts, and test these tools because they do not know them, I managed to get to a palliative solution, the migration was not perfect, because it would not be possible because osTicket in version 1.2 was only 10 tables, already in new stable version 1.6 had 19.
So no more story below is the video showing actions taken to complete the update version.
Follow the steps below:
1 – Make a dump of the database osTicket 1.2 to your local machine (localhost), within your xampp or wamp (I’m assuming you already have installed and configured, in this post do not address this configuration.).
2 – After this, if you have not installed the new version of osTicket on your local machine, download here and install it on your xampp or wamp
3 – Rename the database to osticket1.2 “osticket1_2”
4 – Rename the database to osticket1.6 “osticket1_6”
5 – Done the above steps, now just run the following SQL:
A) – Run the following SQL in your favorite editor MySQL, PHPMyAdmin can be up to. The first SQL import all the tickets osTicket osTicket 1.2 to 1.6.
INSERT INTO `osticket1_6`.`ost_ticket` ( `ticketID` , `dept_id` , `priority_id` , `topic_id` , `staff_id` , `email` , `name` , `subject` , `helptopic` , `phone` , `phone_ext` , `ip_address` , `status` , `source` , `isoverdue` , `isanswered` , `duedate` , `reopened` , `closed` , `lastmessage` , `lastresponse` , `created` , `updated` ) select oldtable.ID, 2, #dept_id oldtable.priority, NULL, 1, oldtable.email , oldtable.name , oldtable.subject , NULL, oldtable.phone , NULL , oldtable.ip, oldtable.status , NULL , NULL, NULL, NULL, NULL, NULL, oldtable.trans_msg, NULL, oldtable.timestamp, oldtable.timestamp from osticket1_2.tickets AS oldtable
B) – Now Running SQL below, we will be importing the questions that every customer has to support:
INSERT INTO `osticket1_6`.`ost_ticket_message`( ticket_id, messageId, message, headers, source, ip_address, created, updated ) SELECT ticket_id, #ticket_id t2.message, #messageId t2.message, #message t2.headers, # headers 'Email', #source NULL, #ip_address, t2.timestamp, #created NULL #updated FROM `osticket1_6`.`ost_ticket` t1 INNER JOIN `osticket1_2`.`ticket_messages` t2 ON t1.ticketid=t2.ticket
C) – Now the SQL below the answers matter.
INSERT INTO `osticket1_6`.`ost_ticket_response`( msg_id, ticket_id, staff_id, staff_name, response, ip_address, created, updated ) SELECT t1.msg_id, #msg_id t1.ticket_id, #ticket_id, 5, #staff_id (supondo que o admin seja id 5) 'Admin', t3.message, NULL, #ip_address, t3.timestamp, #created NULL #updated FROM `osticket1_6`.`ost_ticket_message` t1 INNER JOIN `osticket1_6`.`ost_ticket` t2 ON t1.ticket_id=t2.ticket_id INNER JOIN `osticket1_2`.`ticket_answers` t3 ON t2.ticketid=t3.ticket
So is it folks, if anyone has anything to add, comment I change the post to add more information.
Until next post!