[SOLVED] OTRS 6 Upgrade on CentOS 6

Moderator: crythias

Post Reply
S1lv3rW1z4rd
Znuny newbie
Posts: 24
Joined: 10 Oct 2017, 13:45
Znuny Version: 6.0.30
Real Name: NB
Company: montova

[SOLVED] OTRS 6 Upgrade on CentOS 6

Post by S1lv3rW1z4rd »

Hi,

I'm unable to find details whether or not OTRS 6 Free is supported on CentOS 6 ?
I currently run 5.0.23 on CentOS 6.9.

I'm looking to upgrade to 6 but the RPM is only available for CentOS7 ?
Last edited by S1lv3rW1z4rd on 18 Jan 2018, 12:43, edited 1 time in total.
Running OTRS 6 Community Edition (6.0.30) on CentOS 7.9/MYSQL/Apache2
root
Administrator
Posts: 3934
Joined: 18 Dec 2007, 12:23
Znuny Version: Znuny and Znuny LTS
Real Name: Roy Kaldung
Company: Znuny
Contact:

Re: OTRS 6 Upgrade on CentOS 6

Post by root »

Hi,

The bundled Perl version of CentOS 6 is too old.

- Roy
Znuny and Znuny LTS running on CentOS / RHEL / Debian / SLES / MySQL / PostgreSQL / Oracle / OpenLDAP / Active Directory / SSO

Use a test system - always.

Do you need professional services? Check out https://www.znuny.com/

Do you want to contribute or want to know where it goes ?
S1lv3rW1z4rd
Znuny newbie
Posts: 24
Joined: 10 Oct 2017, 13:45
Znuny Version: 6.0.30
Real Name: NB
Company: montova

Re: OTRS 6 Upgrade on CentOS 6

Post by S1lv3rW1z4rd »

OK I confirm the current version running is Perl 5.10.1.

Is there an official migration guide available to move from one host to another ?
Running OTRS 6 Community Edition (6.0.30) on CentOS 7.9/MYSQL/Apache2
root
Administrator
Posts: 3934
Joined: 18 Dec 2007, 12:23
Znuny Version: Znuny and Znuny LTS
Real Name: Roy Kaldung
Company: Znuny
Contact:

Re: OTRS 6 Upgrade on CentOS 6

Post by root »

Hi,

A complete backup and restore is sufficient.

- Roy
Znuny and Znuny LTS running on CentOS / RHEL / Debian / SLES / MySQL / PostgreSQL / Oracle / OpenLDAP / Active Directory / SSO

Use a test system - always.

Do you need professional services? Check out https://www.znuny.com/

Do you want to contribute or want to know where it goes ?
S1lv3rW1z4rd
Znuny newbie
Posts: 24
Joined: 10 Oct 2017, 13:45
Znuny Version: 6.0.30
Real Name: NB
Company: montova

Re: OTRS 6 Upgrade on CentOS 6

Post by S1lv3rW1z4rd »

The restore and backup documentation is not complete as I end up with this error;

Code: Select all

Restore /backup/2017-12-14_08-23//Config.tar.gz ...
ERROR: Already existing tables in this database. A empty database is required for restore!
So I go to the new empty OTRS 5.0.23 install I created on a CentOS 7.4.
And delete all tables from the database.

I remain with table users and valid as they cannot be dropped due to foreign key constraint fails either one I try to drop first.
So I set option;

SET FOREIGN_KEY_CHECKS=0;

drop both tables and now database otrs is empty.

So I feel relieved but now another issue;

Code: Select all

Restore /backup/2017-12-14_08-23//Config.tar.gz ...
[Thu Dec 14 13:50:19 2017] restore.pl: DBI connect('database=otrs;host=localhost;','otrs',...) failed: Access denied for user 'otrs'@'localhost' (using password: YES) at /opt/otrs/Kernel/System/DB.pm line 203.
ERROR: OTRS-restore.pl-10 Perl: 5.16.3 OS: linux Time: Thu Dec 14 13:50:19 2017

 Message: Access denied for user 'otrs'@'localhost' (using password: YES)

 Traceback (363):
   Module: Kernel::System::DB::Prepare Line: 667
   Module: ./restore.pl Line: 121

Can't call method "fetchrow_array" on an undefined value at /opt/otrs/Kernel/System/DB.pm line 747.
I tried to give user otrs all privileges as user root but this doesn't seem to work or get applied.
I don't even know if I'm going in the right direction with all of this so please help me out ?
Running OTRS 6 Community Edition (6.0.30) on CentOS 7.9/MYSQL/Apache2
coolmf
Znuny newbie
Posts: 37
Joined: 02 Nov 2015, 16:29
Znuny Version: 5.0.26

Re: OTRS 6 Upgrade on CentOS 6

Post by coolmf »

I have done a couple of restores, i always drop the database and create a new empty one.

Your new problem looks to be wrong password for otrs database. Is old otrs database pw different from nev database pw?
OTRS 5.0.26 with ITSM, and FAQ module on CentOS 7 with MariaDB and Apache
Using LDAPS for customers and agents against Azure AD
S1lv3rW1z4rd
Znuny newbie
Posts: 24
Joined: 10 Oct 2017, 13:45
Znuny Version: 6.0.30
Real Name: NB
Company: montova

Re: OTRS 6 Upgrade on CentOS 6

Post by S1lv3rW1z4rd »

Yes the password in the current OTRS production instance is different.
Unfortunately I don't know the password as it was not setup by me.

From a select statement on the old instance it looks like the otrs password is stored hashed.
While in the new instance the password is not hashed and shows in plain text.

I tried dropping database otrs, create a new one and do the restore.
Same issue.

But it looks like the user accounts are stored in database mysql not in database otrs.
So I dropped database mysql, create new empty one.
Still the same issue.

I expected not to be able to logon to mariadb at this point as all the users are removed from database mysql.
But I'm still able to do so with the root passwd I selected earlier while the table is gone :?
Running OTRS 6 Community Edition (6.0.30) on CentOS 7.9/MYSQL/Apache2
S1lv3rW1z4rd
Znuny newbie
Posts: 24
Joined: 10 Oct 2017, 13:45
Znuny Version: 6.0.30
Real Name: NB
Company: montova

Re: OTRS 6 Upgrade on CentOS 6

Post by S1lv3rW1z4rd »

tried to change the password in the old running instance with below commands;

mysql> UPDATE mysql.user SET Password=PASSWORD('new password') WHERE User='otrs';
mysql> FLUSH PRIVILEGES;
mysql> quit;

But afterwards I'm not able to access the interface because of the changes I did to user otrs.
So I reverted to a snapshot as it's not clear where to update this password in the otrs instance itself.
Running OTRS 6 Community Edition (6.0.30) on CentOS 7.9/MYSQL/Apache2
S1lv3rW1z4rd
Znuny newbie
Posts: 24
Joined: 10 Oct 2017, 13:45
Znuny Version: 6.0.30
Real Name: NB
Company: montova

Re: OTRS 6 Upgrade on CentOS 6

Post by S1lv3rW1z4rd »

I've put the password from the old CentOS 6 instance through on online hasher and configured it on the new CentOS 7 mysql.
So at this point for user otrs the hashes match on both systems.

Tried to run the restore again but still the same issue.

Code: Select all

./restore.pl -b /backup/2017-12-14_08-23/ -d /opt/otrs
Restore /backup/2017-12-14_08-23//Config.tar.gz ...
[Tue Dec 26 10:51:15 2017] restore.pl: DBI connect('database=otrs;host=127.0.0.1','otrs',...) failed: Access denied for user 'otrs                                    at /opt/otrs/Kernel/System/DB.pm line 203.
ERROR: OTRS-restore.pl-10 Perl: 5.16.3 OS: linux Time: Tue Dec 26 10:51:15 2017

 Message: Access denied for user 'otrs'@'localhost' (using password: YES)

 Traceback (4106):
   Module: Kernel::System::DB::Prepare Line: 667
   Module: ./restore.pl Line: 121
I don't see what still can be the issue now ??
At first I was not able to access the web interface on the new CentOS7 instance because of the password change, but after a while it seems I can now.
I did not drop database otrs or mysql now in CentOS 7, they are in the initial 5.0.23 install state.
Running OTRS 6 Community Edition (6.0.30) on CentOS 7.9/MYSQL/Apache2
jojo
Znuny guru
Posts: 15019
Joined: 26 Jan 2007, 14:50
Znuny Version: Git Master
Contact:

Re: OTRS 6 Upgrade on CentOS 6

Post by jojo »

I think you mix up database password and user passwords within OTRS.

- create a new CentOS 7 system
- install latest version of OTRS5 on new server (including running the database scripts), use the same password for OTRS user then on the old system
- drop the database otrs
- create database otrs in charset utf-8
- use the restore script ( I prefer to do it manually)
- delete all caches
-> now you should have the OTRS5 running on the new system

-> now start migration to OTRS6
"Production": OTRS™ 8, OTRS™ 7, STORM powered by OTRS
"Testing": ((OTRS Community Edition)) and git Master

Never change Defaults.pm! :: Blog
Professional Services:: http://www.otrs.com :: enjoy@otrs.com
coolmf
Znuny newbie
Posts: 37
Joined: 02 Nov 2015, 16:29
Znuny Version: 5.0.26

Re: OTRS 6 Upgrade on CentOS 6

Post by coolmf »

On old system, have a look in Kernel/Config.pm Connection to database is in there (including pw in clear text)
On new system: change database pw so it matches the one from old system.
OTRS 5.0.26 with ITSM, and FAQ module on CentOS 7 with MariaDB and Apache
Using LDAPS for customers and agents against Azure AD
S1lv3rW1z4rd
Znuny newbie
Posts: 24
Joined: 10 Oct 2017, 13:45
Znuny Version: 6.0.30
Real Name: NB
Company: montova

Re: OTRS 6 Upgrade on CentOS 6

Post by S1lv3rW1z4rd »

Ok thx for the help jojo and coolmf !

It seems dropping the database otrs was still required.
Here are the steps I've done;
  • On the new instance change password in database mysql for user otrs in table user.
    drop database otrs;
    create database otrs CHARACTER SET utf8 COLLATE utf8_general_ci;

    Perform the restore

    su -c "perl bin/otrs.Console.pl Maint::Cache::Delete" -s /bin/bash otrs
I'm now running the 5.0.23 instance on CentOS 7
Running OTRS 6 Community Edition (6.0.30) on CentOS 7.9/MYSQL/Apache2
S1lv3rW1z4rd
Znuny newbie
Posts: 24
Joined: 10 Oct 2017, 13:45
Znuny Version: 6.0.30
Real Name: NB
Company: montova

Re: OTRS 6 Upgrade on CentOS 6

Post by S1lv3rW1z4rd »

I upgraded the 5.0.23 instance running on CentOS 7 to 6.0.3 yesterday evening.
After a few attempts I was able to do so without issues.

I did an additional step not documented in the current upgrade guide, but found it in the guide for going from 4 to 5.

Code: Select all

command bin/otrs.Console.pl Maint::Database::MySQL::InnoDBMigration
I had about 96 tables that needed migration to innodb.

Also removed all Znuny addons from the local reposity before starting the upgrade.

Now it runs fine, only issue at the moment is that previously the dashboard overview was sorted on age with newest on top.
Now in the new version the new and open ticket view is still sorted on age but the oldest is at the top.
This is not how we like to use it, so trying to figure out how to change this.
Running OTRS 6 Community Edition (6.0.30) on CentOS 7.9/MYSQL/Apache2
Post Reply