Ok Finally I've done it.. I've upgraded my OTRS from 3.0.7 to 3.0.12 to 3.1.12 and using WINDOWS! And like I said before, I would write a small how to and here it is. It is still a work in progress.
The UPGRADING manual that comes with OTRS is meant for LINUX. It is usefull for windows but if you are a n00b or have cero experience then this can be a challenge. This is my how to.. for dummies.
Ok.. some basics:
- Read all this manual first, then read it again and once you have understand it put it into motion.
- Usea a TEST enviroment first… but you are very smart so you already knew that one.
- This worked for me… you may or may not have diffrent settings.
- Steps 8 to 11 are the most prone to errors. If something goes wrong in any of these steps, your data might be corrupted and you have to star all over again, delete everything from step 3.
So.. here is the quick how to :
STOP all services.
1. You have to make a back up of everything, this is not negotiable. Back up your entire X:\Program Files\OTRS folder. What I did is to RENAME the folder from X:\Program Files\OTRS to X:\Program Files\OTRS 3.0.12
(X being the drive where you have your OTRS installed, usually is C:\. This way you have an instant back up.
2. Rename the START MENU folder… yes, the one with all the shortcuts to OTRS 3.0.12 , trust me on this one, it will come in handy later.
3. Install OTRS 3.1.12… just like that, install it as if it were your first time. Don’t worry about data loss. Remember, everything is safe and sound on the OTRS 3.0.12 folder we created on step 1. The new installation will create a NEW folder so it will not overwrite anything. If you feel a little nervous about this step, go head and copy the previous installations somewhere else, like a pen drive or something.
4. Go trough the web installer with all the defaults, you don’t have to configure ANYTHING, go trough the DB defaults, skip the email configurations, we don’t need that. What we need is a CLEAN OTRS INSTALLATION. OK?? If you are a n00b you may wonder.. WHY? OK, I’ll tell you: All the defaults will be replaced later by our own configurations and database.
5. Here is where the manual actually comes in handy, from your previous OTRS:
5.1 From the folder X:\Program Files\OTRS 3.0.12
, COPY the following files
- FROM X:\Program Files\OTRS 3.0.12\Kernel\Config.Pm
TO X:\Program Files\OTRS\Kernel\
- FROM X:\Program Files\OTRS 3.0.12\Kernel\Config\GenericAgent.Pm
TO X:\Program Files\OTRS\Kernel\Config
- FROM X:\Program Files\OTRS 3.0.12\Kernel\Config\Files\ZZZAuto.pm
TO X:\Program Files\OTRS\Kernel\Files
…yes… replace the new files with the old ones.
These are the only files you need. These and only these. Don’t copy any other file.
6. Now is time to copy the database. No big deal, just copy the following folder from X:\Program Files\OTRS 3.0.12\data\otrs
paste it [and replace it] in X:\Program Files\OTRS\data\otrs
7. Start Services. Go to Star –> All programs –>OTRS –> TOOLS –> OTRS Services Start …
8. Now comes the tricky part: In the manual you’ll find the following at step 7: Set file permissions
——————– If the tarball is used, execute: shell> cd /opt/otrs/
with the permissions needed for your system setup.
This script will not work on Windows, so don’t even try it. YET it is needed, but -How?- you may ask. Good luck for you I’m here to help you. This is simple: You must have all permissions for the folder OTRS. It doesn’t matter if you already are the System Admin, sometimes you have to give yourself full permissions. To do this: Right click on the OTRS folder –>Properties –> Security Tab. Here, and just to be safe, give full control
to all users.
9. Now you have to run the following script: DBUpdate-to-3.1.mysql.sql
located at X:\Program Files\OTRS\OTRS\Scripts
But then again, this is intended for Linux, good luck trying to execute from the Command Line on windows. To walk around this issue you’ll need a program to execute individual querys such as MySQL Workbench, wich you can download from here http://dev.mysql.com/downloads/workbench/
There are several other programs but this is the one I use. No matter what program you use, a connection with the DataBase has to be made.(Before you begin to execute query, remember to have a connection from your program to the OTRS database)Anyway.. now we enter the most delicate part. Risk of loss of data, be carefull.
9.1 Open the DBUpdate-to-3.1.mysql.sql with notepad, you’ll see something like this
# driver: mysql, generated: 2012-07-05 09:13:21
# alter table ticket_index
ALTER TABLE ticket_index CHANGE queue queue VARCHAR (200) NULL;
ALTER TABLE ticket_index ALTER queue DROP DEFAULT;
UPDATE ticket_index SET queue = ” WHERE queue IS NULL;
ALTER TABLE ticket_index CHANGE queue queue VARCHAR (200) NOT NULL;
# alter table ticket_index
ALTER TABLE ticket_index CHANGE s_state s_state VARCHAR (200) NULL;
ALTER TABLE ticket_index ALTER s_state DROP DEFAULT;
UPDATE ticket_index SET s_state = ” WHERE s_state IS NULL;
ALTER TABLE ticket_index CHANGE s_state s_state VARCHAR (200) NOT NULL;
…and more and more and more…
Just in case you don’t know anything about MySQL, each line is a MySQL query and is delimited by ” ; ” For example:
ALTER TABLE ticket_index ALTER s_state DROP DEFAULT; <---- That’s a query.
# alter table ticket_index
That is NOT a query.
CREATE TABLE gi_debugger_entry_content (
id BIGINT NOT NULL AUTO_INCREMENT,
gi_debugger_entry_id BIGINT NOT NULL,
debug_level VARCHAR (50) NOT NULL,
subject VARCHAR (255) NOT NULL,
content LONGBLOB NULL,
create_time DATETIME NOT NULL,
INDEX gi_debugger_entry_content_create_time (create_time),
INDEX gi_debugger_entry_content_debug_level (debug_level)
); <— haha sad face
That is a big query.
I copied the whole content of the script and paste it inside the MySQL Workbench to execute query by query (from the notepad, select and copy all the text). The first time I tried to execute the script as a whole but it didn’t work, so executed it query by query.. tedious but you’ll thank me later. The following image is how it looks once the text has been pasted inside the MySQL workbench. You’ll notice a blue dot at the beginning of some lines, each blue dot represents a query. The blue texts are comments, ignore them.
I went trough all the file, executing each blue dot one by one. You may try to execute them all at once, if you have no errors, good, if you have one or more errors, then try it one by one. There is a big danger here, because you are dealing with data, if something goes wrong you have the risk to have data corruption. So, just to be sure, execute it query by query… , don’t tell me later I didn’t warn you.
10. Once you have executed the previous script with NO ERRORS, execute the next script from the command line, located at X:\Program Files\OTRS\OTRS\Scripts\DBUpdate-to-3.1.pl
I messed up with the file name. The command is:perl DBUpdate-to-3.1.pl
Now you'll see a lot of weird stuff on your screen, this is normal and it will take some time depending on your Database size and Hardware. There are 24 steps that have to finish with NO errors. Once its done it'll look something like this:
11. There is another SQL script that we have to execute, once again, from the MySQL Workbench. This one is DBUpdate-to-3.1-post.mysql.sq
l located atX:\Program Files\OTRS\OTRS\Scripts\
Again, open the file using NOTEPAD and copy the whole content into MySQL Workbench. You can execute the whole file at once, you don’t need to go query by query.
12. And you are almost done, the most critical and important part is finished… Now, the manual ask us to run the following scripts, again from the command line go toX:\Program Files\OTRS\OTRS\bi
n and execute:
- perl otrs.RebuildConfig.pl
- perl otrs.DeleteCache.pl
You’ll see nothing with these ones… hell, not even a confirmation message. Just type the first command and hit enter, type the second command and hit enter.
AND YOU ARE DONE!!! Good job, now try to log on to your system using the same credentials you used to have on your previous version. It should work. If there is an error message then you did something wrong, you fail, you have to do it all over again.
Note 1: Although the UPGRADING manual is intended for linux, you HAVE TO READ IT, understand it and figure it out. It won’t work for if you have a Windows system but still…
Note 2: On the upgrading manual, steps from 10 to 21… I didn’t even read’em.Note 3. If you had any modifications to the source code, they are gone now. You’ll have to do them all over again.
Note 4. Depending on your DB configuration, you may have to copy the folder with all the attachements from your previous installation to the new one.