HOWTO split OTRS into two instances

sometimes you need to split OTRS into two or more instances. You can just backup/restore database,
copy all OTRS files. Change paths, change SystemID and so on!
What to do with articles stored on file system. Should I copy all 20 GB also?
Not really! I can move only necessary files.

First of all let's create directory structure on new instance. SQL can help us with query


SELECT distinct DATE_FORMAT(create_time, 'mkdir %Y\\%m\\%d') a FROM ticket  


save output into batch file and execute it in the directory /otrs/var/article/

Next step to select all articles. Let's suppose we want to move queues with IDs 1,3,5,10 etc.
SELECT CONCAT(DATE_FORMAT(a.create_time, 'move %Y\\%m\\%d\\'),convert(a.id,char(20)), ' C:\\path_to_new_OTRS\\var\\article\\',DATE_FORMAT(a.create_time, '%Y\\%m\\%d\\')) a 
FROM article a JOIN ticket t  ON t.id=a.ticket_id
WHERE  t.queue_id in (1,3,5,10); 


save output again into batch file and execute it in the directory /otrs/var/article/

Enjoy!

No comments:

HOWTO: Repair Logitech M325 Mouse

FixIt says that you will find single screw under CE label. It isn't always true.