How to Upgrade OTRS from 3.0 to 3.1 on WINDOWS!

Dont create your support topics here! No new topics with questions allowed!

Moderator: crythias

Forum rules
Dont create your support topics here! No new topics with questions allowed!
Post Reply
guillo
Znuny newbie
Posts: 98
Joined: 16 May 2012, 20:05
Znuny Version: 3.0.7

How to Upgrade OTRS from 3.0 to 3.1 on WINDOWS!

Post by guillo »

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/
shell> bin/otrs.SetPermissions.pl

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,
PRIMARY KEY(id),
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.

Image

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

Image
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:

Image


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.sql located at
X:\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 to
X:\Program Files\OTRS\OTRS\bin 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.
OTRS V 3.0.7 Windows 2008 x64 going for 3.1.7
OTRS 3.1.12 on LINUX UBUNTU SERVER
crythias
Moderator
Posts: 10169
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: How to Upgrade OTRS from 3.0 to 3.1 on WINDOWS!

Post by crythias »

Nice HowTo.

I believe the mysql client command line application also comes with OTRS, so if you don't want to load MySQL workbench, you can use the CLI to follow the instructions per the UPGADING file in the release.

Linux:
cd /opt/otrs
cat scripts/DBUpdate-to-3.1.mysql.sql | mysql -p -f -u root otrs

Windows:
cd \Program Files\OTRS\OTRS
type scripts\DBUpdate-to-3.1.mysql.sql | mysql -p -f -u root otrs

(if mysql isn't in the path, put the full path to the mysql binary)

Linux:
scripts/DBUpdate-to-3.1.pl

Windows:
perl scripts\DBUpdate-to-3.1.pl


Linux:
cat scripts/DBUpdate-to-3.1-post.mysql.sql | mysql -p -f -u root otrs

Windows:
type scripts\DBUpdate-to-3.1-post.mysql.sql | mysql -p -f -u root otrs


Don't forget to restart your services.
OTRS 6.0.x (private/testing/public) on Linux with MySQL database.
Please edit your signature to include your OTRS version, Operating System, and database type.
Click Subscribe Topic below to get notifications. Consider amending your topic title to include [SOLVED] if it is so.
Need help? Before you ask
guillo
Znuny newbie
Posts: 98
Joined: 16 May 2012, 20:05
Znuny Version: 3.0.7

Re: How to Upgrade OTRS from 3.0 to 3.1 on WINDOWS!

Post by guillo »

crythias wrote:Nice HowTo.

I believe the mysql client command line application also comes with OTRS, so if you don't want to load MySQL workbench, you can use the CLI to follow the instructions per the UPGADING file in the release.

It never worked for me, I kept getting these user & password errors.

crythias wrote:Don't forget to restart your services.
You mean like a a reboot? Becase I have my services up since step 7. Is the only way I could run the sql and perl scripts.
OTRS V 3.0.7 Windows 2008 x64 going for 3.1.7
OTRS 3.1.12 on LINUX UBUNTU SERVER
bayerex
Znuny expert
Posts: 164
Joined: 03 Dec 2012, 00:30
Znuny Version: 3.2.7

Re: How to Upgrade OTRS from 3.0 to 3.1 on WINDOWS!

Post by bayerex »

Awesome!! At last!! Thank you so much for posting this.
Current Production Server (recently switched from Windows)
OTRS 3.2.7 on Ubuntu 12.04LTS 64bit
PHP 5.3.10-1ubuntu3.6
mysql Ver 14.14 Distrib 5.5.31

Previous Production Server:
Windows 2008
MySQL 5.1.51 Community Server
Strawberry Perl 5.12.3.0
guillo
Znuny newbie
Posts: 98
Joined: 16 May 2012, 20:05
Znuny Version: 3.0.7

Re: How to Upgrade OTRS from 3.0 to 3.1 on WINDOWS!

Post by guillo »

crythias wrote:

Don't forget to restart your services.
From what I've learned, you can't run the scripts if you don't have the services running.
OTRS V 3.0.7 Windows 2008 x64 going for 3.1.7
OTRS 3.1.12 on LINUX UBUNTU SERVER
crythias
Moderator
Posts: 10169
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: How to Upgrade OTRS from 3.0 to 3.1 on WINDOWS!

Post by crythias »

guillo wrote:
crythias wrote:Don't forget to restart your services.
You mean like a a reboot? Becase I have my services up since step 7. Is the only way I could run the sql and perl scripts.
Yeah, oops. :-) Sorry about not catching that.
guillo wrote:It never worked for me, I kept getting these user & password errors.
If so, it's because the information is asking about root.

mysql -p (ask for password) -f (force: keep going, even if SQL error) -u (username) (database name)

these can be replaced by the Config.pm values (I'm showing them as placeholders. This means replace the placeholders with the values in Config.pm Don't copy/paste)

mysql -p -f -u $Self->{DatabaseUser} $Self->{Database}
Password: $Self->{DatabasePw}

Sometimes if you have a $ in the username or password you might have issues.
OTRS 6.0.x (private/testing/public) on Linux with MySQL database.
Please edit your signature to include your OTRS version, Operating System, and database type.
Click Subscribe Topic below to get notifications. Consider amending your topic title to include [SOLVED] if it is so.
Need help? Before you ask
Sofia
Znuny newbie
Posts: 12
Joined: 27 Sep 2011, 15:49
Znuny Version: 3.0.10
Location: Sweden

Re: How to Upgrade OTRS from 3.0 to 3.1 on WINDOWS!

Post by Sofia »

Thank you, this was very helpful! I have been reluctant to upgrade until I had some more information about that and you did a very fine job!

One question to this - does anyone have experience from a similar 3.0.x upgrade to a later version using MSSQL instead of MySQL? Is there anything particular to keep in mind (except from doing a proper backup before upgrading that is..) I'm grateful for any input and experience from this.
OTRS 3.0.10/Win 2003/MSSQL 2008
Small company, worldwide support :-)
guillo
Znuny newbie
Posts: 98
Joined: 16 May 2012, 20:05
Znuny Version: 3.0.7

Re: How to Upgrade OTRS from 3.0 to 3.1 on WINDOWS!

Post by guillo »

Sofia wrote:Thank you, this was very helpful! I have been reluctant to upgrade until I had some more information about that and you did a very fine job!

One question to this - does anyone have experience from a similar 3.0.x upgrade to a later version using MSSQL instead of MySQL? Is there anything particular to keep in mind (except from doing a proper backup before upgrading that is..) I'm grateful for any input and experience from this.
I'm glad you find it useful! :)

I don't have experience with MSSQL, but from what I've read in other post, is pretty much the same: backup and keep going as is.
OTRS V 3.0.7 Windows 2008 x64 going for 3.1.7
OTRS 3.1.12 on LINUX UBUNTU SERVER
jkalemis
Znuny newbie
Posts: 3
Joined: 21 May 2013, 02:44
Znuny Version: 3.1.7
Real Name: James Kalemis
Company: Advanced Clinical

Re: How to Upgrade OTRS from 3.0 to 3.1 on WINDOWS!

Post by jkalemis »

Hello,
Will this also work for going from 3.1.7 -> 3.2.6?

Thanks,
James.
v3.2.8 on Windows 7 Pro in HyperV/Windows Server 2008
guillo
Znuny newbie
Posts: 98
Joined: 16 May 2012, 20:05
Znuny Version: 3.0.7

Re: How to Upgrade OTRS from 3.0 to 3.1 on WINDOWS!

Post by guillo »

It will work with any version.
OTRS V 3.0.7 Windows 2008 x64 going for 3.1.7
OTRS 3.1.12 on LINUX UBUNTU SERVER
theodore
Znuny newbie
Posts: 26
Joined: 09 Jun 2010, 12:51
Znuny Version: 3.3.11

Re: How to Upgrade OTRS from 3.0 to 3.1 on WINDOWS!

Post by theodore »

Hello,

Here is also a compact guide for the upgrading

Consideration:
Installation uses MySQL
Installation has FAQ module installed
Installation does not use ActiveState Perl
The bellow example uses the installation folder c:\OTRS\

Upgrade OTRS from version 3.0.x to 3.1.x to 3.2.x to 3.3.x

1. Backup the system settings
Login as SYSTEM and select "ADMIN" -> "SysConfig" -> "Export Settings"

2. Backup the database
a. Open a command prompt and navigate to the folder C:\OTRS\MYSQL\BIN
b. Run the command mysqldump -uroot OTRS > C:\OTRS_BCK.SQL

2. Backup the folder that you have installed OTRS
a. Stop the OTRS services running the commands in command prompt:
a1. NET STOP CRON
a2. "C:\OTRS\Apache\bin\httpd.exe" -k stop
a2. NET STOP MySQL
b. Backup the folder C:\OTRS\

3. Backup the start menu folder OTRS and the OTRS *.bat scripts
C:\Documents and Settings\All Users\Start Menu\Programs\OTRS
C:\OTRS\otrs4win\Scripts

4. Uninstall OTRS from the "Add/Remove Programs"

5. Install OTRS 3.1.x
a. Do not install ActiveState Perl
b. Install it to the same directory (C:\OTRS\)
c. Install the bundled MySQL
d. Do not change anything else and proceed with the install
e. At the end when the web installer starts just close the internet explorer window

6. Copy the old config.pm (from the backup) to the new installation (C:\OTRS\OTRS\Kernel\)
a. set the path of the otrs to the new installation directory
$Self->{Home} = 'C:/OTRS/OTRS';
b. note the database user at the following line
$Self->{'DatabaseUser'} = 'otrs';
c. note the database password at the following line
$Self->{'DatabasePw'} = 'password';

7. Create the database
a. open a command prompt and run the following commands:
SET PATH=%PATH%;C:\OTRS\StrawberryPerl\perl\bin;C:\OTRS\MySQL\bin
b. create the DB by entering the MySQL command line by running the commands:
mysql -uroot
in the MySQL prompt run the following:
show databases;
CREATE DATABASE otrs CHARACTER SET utf8;
GRANT all ON otrs.* TO 'otrs'@'localhost' IDENTIFIED BY 'password';
FLUSH PRIVILEGES;
EXIT
back in the windows command prompt run the command to import the backup of the database:
mysql -uroot otrs < c:\otrs_bck.sql

8. Copy from the backup the content of the folder C:\OTRS\OTRS\var\article to the new installation

9. Run the SQL upgrade scripts
a. Note that the order that the scripts run is:
first *.sql
second *.pl
thind *-post*.sql (if exists)
b. open a command prompt and run the following commands
SET PATH=%PATH%;C:\OTRS\StrawberryPerl\perl\bin;C:\OTRS\MySQL\bin
CD \OTRS\OTRS\scripts
mysql -uroot otrs < DBUpdate-to-3.1.mysql.sql
perl DBUpdate-to-3.1.pl
mysql -uroot otrs < DBUpdate-to-3.1-post.mysql.sql

10.Restore the start menu folder OTRS and the OTRS *.bat scripts
C:\Documents and Settings\All Users\Start Menu\Programs\OTRS
C:\OTRS\otrs4win\Scripts

11.Restore the system settings
Login as SYSTEM and select "ADMIN" -> "SysConfig" -> "Import Settings"

12.Upgrade the FAQ module
Login as SYSTEM and select "ADMIN" -> "SysConfig" -> "Package Manager"
a. press "Update repository information"
b. select "Upgrade" for the FAQ module (under the "Online Repository" section)
c. The upgrade will take a long time so do not restart services or the PC.

13.Restart the computer

14.Edit any files that you have changed and make the changes again.
Files like the:
kernel/system/ticket.pm
Kernel/Modules/AgentTicketCompose.pm

I hope that this will help someone
OTRS 3.3.11 MariaDB CentOS 7
hannibal_
Znuny newbie
Posts: 14
Joined: 05 Oct 2011, 10:05
Znuny Version: 3.0.10
Real Name: Tomasz
Company: x

Re: How to Upgrade OTRS from 3.0 to 3.1 on WINDOWS!

Post by hannibal_ »

theodore
Are you doing the upgrade directly from version 3.0.x to 3.3.x? With the exception of version 3.1.x and 3.2.x? :?
-------------------------------------------------------------------
OTRS 3.0.10 (public) on WinServ 2008 R2 with MySQL database.
Post Reply