OTR upgrade path

Moderator: crythias

Post Reply
rajbps
Znuny newbie
Posts: 44
Joined: 02 Jan 2014, 22:02
Znuny Version: 3.3.3
Real Name: Raj
Company: Business Park Solutions Ltd

OTR upgrade path

Post by rajbps »

Hi Team,

I have otrs 5.0.7 installed on centos7.

Can anyone advise on how to upgrade from 5.0.7 to 5.0.9 please.
Sorry I am a newbie at otrs and detailed steps would be great.

Regards,

Rajbps
Giulio Soleni
Znuny wizard
Posts: 392
Joined: 30 Dec 2010, 14:35
Znuny Version: 6.0.x and 5.0.x
Real Name: Giulio Soleni
Company: IKS srl

Re: OTR upgrade path

Post by Giulio Soleni »

Hi rajbps,
updating from a minor to another minor version should not be a great issue and first of all I would suggest to wait a little bit more since version 5.0.9 has been released a month ago and I think that a new version is coming very soon.
Anyhow, you may take https://otrs.github.io/doc/manual/admin ... ading.html as a leading guide, but you may safely skip some steps like the database upgrade.

Considering more in details the main steps should be:
1. take a backup of the present system (you should use /opt/otrs/scripts/backup.pl command)

2. run a yum update to start the upgrade process on a CentOS updated system

3. Stop all relevant services
su -c "/opt/otrs/bin/otrs.Daemon.pl stop" -s /bin/bash otrs
su -c "/opt/otrs/bin/Cron.sh stop" -s /bin/bash otrs This may fail (since it should be already stopped by the previous one)
su -c "/opt/otrs/bin/otrs.Console.pl Maint::Cache::Delete" -s /bin/bash otrs
su -c "/opt/otrs/bin/otrs.Console.pl Maint::Session::DeleteAll" -s /bin/bash otrs
su -c "/opt/otrs/bin/otrs.Console.pl Maint::Loader::CacheCleanup" -s /bin/bash otrs
su -c "/opt/otrs/bin/otrs.Console.pl Maint::Loader::CacheGenerate" -s /bin/bash otrs
systemctl stop httpd.service
systemctl stop crond.service

4. check system date (optional but suggested)
systemctl stop ntpd
ntpdate pool.ntp.org >>> or your internal ntp server
systemctl start ntpd
systemctl status ntpd

5. define some provisional folders, take some important backups and download the new OTRS rpm package
mkdir -p /otrs_bck/ver5.0.9/custom/
mkdir -p /otrs_bck/ver5.0.9/orig/
mkdir -p /otrs_bck/ver5.0.9/backup/

cp -p /opt/otrs/Kernel/Config.pm /otrs_bck/ver5.0.9/backup/Config.pm
cp -p /opt/otrs/Kernel/Config/Files/ZZZAuto.pm /otrs_bck/ver5.0.9/backup/ZZZAuto.pm
cp -p /opt/otrs/var/log/TicketCounter.log /otrs_bck/ver5.0.9/backup/TicketCounter.log
cd /otrs_bck/ver5.0.9/
wget http://ftp.otrs.org/pub/otrs/RPMS/rhel/ ... noarch.rpm

6. test for any possible depending package missing and then upgrade
cd /otrs_bck/ver5.0.9
rpm -Uvh --test otrs-5.0.9-01.noarch.rpm
...if everything looks fine:
rpm -Uvh otrs-5.0.9-01.noarch.rpm

double check any possible warning or error that may be issued during the update procedure.
Specifically you may (or may not ;) ) see something like:
warning: /opt/otrs/Kernel/Config.pm created as /opt/otrs/Kernel/Config.pm.rpmnew
and
warning: /opt/otrs/var/log/TicketCounter.log saved as /opt/otrs/var/log/TicketCounter.log.rpmsave


The first warning is related to a needed customization of the /opt/otrs/Kernel/Config.pm that (at least) requires a change in the db password:
cp -p /opt/otrs/Kernel/Config.pm.rpmnew /otrs_bck/ver5.0.9/orig/Config.pm.orig
mv /opt/otrs/Kernel/Config.pm.rpmnew /opt/otrs/Kernel/Config.pm
(it will ask for confirm...)
update then the new /opt/otrs/Kernel/Config.pm file with your database pass
# The password of database user. You also can use bin/otrs.Console.pl Maint::Database::PasswordCrypt
# for crypted passwords
$Self->{DatabasePw} = 'HERE PUT YOUR DB PASS';

The second is related to a possible override of TicketCounter.log ... check any possible difference
diff /opt/otrs/var/log/TicketCounter.log.rpmsave /otrs_bck/ver5.0.9/backup/TicketCounter.log (There should not be any difference... proceed with the following if and only if there aren't any)
mv /opt/otrs/var/log/TicketCounter.log.rpmsave /opt/otrs/var/log/TicketCounter.log

One other file have been overridden, specifically:
/opt/otrs/scripts/apache2-perl-startup.pl
You should consider uncommenting the lines related to the database connection modules within this file, so
cp -p /opt/otrs/scripts/apache2-perl-startup.pl /otrs_bck/ver5.0.9/orig/apache2-perl-startup.pl.orig
update the new file /opt/otrs/scripts/apache2-perl-startup.pl (assuming you are using MySQL or MariaDB) un-commenting the two lines:
# enable this if you use mysql
use DBD::mysql ();
use Kernel::System::DB::mysql;

cp -p /opt/otrs/scripts/apache2-perl-startup.pl /otrs_bck/ver5.0.9/custom/

# IMPORTANT: I assume you do not have ANY code customisation, otherwise you should take care to update all the files you have customized.

7. confirm files permissions
cd /opt/otrs/bin/
./otrs.SetPermissions.pl --otrs-user=otrs --web-group=apache /opt/otrs

8. Rebuild and Restart services
systemctl start crond.service
systemctl start httpd.service
su -c "/opt/otrs/bin/otrs.Console.pl Maint::Config::Rebuild" -s /bin/bash otrs
su -c "/opt/otrs/bin/otrs.Console.pl Maint::Cache::Delete" -s /bin/bash otrs
su -c "/opt/otrs/bin/otrs.Console.pl Maint::Session::DeleteAll" -s /bin/bash otrs
su -c "/opt/otrs/bin/otrs.Console.pl Maint::Loader::CacheCleanup" -s /bin/bash otrs
su -c "/opt/otrs/bin/otrs.Console.pl Maint::Loader::CacheGenerate" -s /bin/bash otrs
su -c "/opt/otrs/bin/otrs.Daemon.pl start" -s /bin/bash otrs

9. (optional) update any OTRS plugin you may have installed.
I suggest you to use the command line and not the web to update your modules, since you have more control on the actual update processes running.
In that case you should locally download the opm files of the plugin that you would like to upgrade.
For example to update FAQ plugin (that we may assume you have downloaded on the local folder /otrs_bck/ver5.0.9/FAQ-5.0.2.opm) just run:

su - otrs
/opt/otrs/bin/otrs.Console.pl Admin::Package::Upgrade /otrs_bck/ver5.0.9/FAQ-5.0.2.opm

That should be all more or less, but please consider integrating my scribbled notes to the official procedure that I already specified here above.
Also, if you can, you are strongly encouraged to take a clone of your system and test the upgrade on your clone before, expecially if you are not yet so experienced in such procedures.

enjoy ;)
OTRS 6.0.x on CentOS 7.x with MariaDB 10.2.x database connected to an Active Directory for Agents and Customers.
ITSM and FAQ modules installed.
rajbps
Znuny newbie
Posts: 44
Joined: 02 Jan 2014, 22:02
Znuny Version: 3.3.3
Real Name: Raj
Company: Business Park Solutions Ltd

Re: OTR upgrade path

Post by rajbps »

Hi Giulio,

Thanks for taking time to put this upgrade guide for me.

I have followed it and I am now at the latest version :-)

Thanks again

Rajbps
Post Reply