[Solved] Migration from OTRS 3.2.9 Windows to Linux

Moderator: crythias

Post Reply
jlamarche
Znuny newbie
Posts: 43
Joined: 22 Nov 2013, 11:01
Znuny Version: 5.0.12
Real Name: Jordan Lamarche
Company: Smarthys

[Solved] Migration from OTRS 3.2.9 Windows to Linux

Post by jlamarche »

Hello everyone,

Once upon a time, one of my boss came to me and said :
"Hey, I found out there's a new version for OTRS that is more beautiful than the current one ! Let's migrate to the newest version of OTRS ! That should be easy. This is YOUR responsibility now. :D "

"Err ... The guy who first installed it did it on Windows", I answered. And I think most of you know why I was so nervous.
And indeed, it has been such a pain in the [...] to migrate from Windows to Linux from a 3.2.9 version (in order to migrate to 3.3, 4.0 and finally 5.0).
And I'm just started since I'm stuck with the Windows to Linux part !

I tried following this guide to migrate to Linux 3.2.9 :
https://otrs.github.io/doc/manual/admin ... s-to-linux

Yes, I know ... That's for 4.0. But I was thinking that maybe it could solve my issue. There were some errors, that was a little bit messy, but at last I thought I had it working ... Except voilà, life is not so simple : all my custom fields disappeared. And I had some errors during the database cloning (only on "Creating structures in target database (phase 2/2)" part). Plus, I find myself unable to migrate to 3.3 because of the previous errors during the cloning operation.

Nota :
- OTRS on Linux 3.2.9 without any data was working fine after installation,
- I dropped the previous otrs database before doing the cloneDB actions,
- I am using the 1.0.13 version of OTRSCloneDB,
- I am using Mariadb (mysql) on CentOS 7.

What I did :
The dry run was successful :

Code: Select all

"Dry run succesfully finished."
The cloning was successful for part 1 :

Code: Select all

C:\otrs\OTRS\bin>perl otrs.CloneDB.pl -r -f
[2016-05-19 15:33:55] Generating DDL for OTRS.
[2016-05-19 15:33:55] Generating DDL for package GeneralCatalog.
[2016-05-19 15:33:55] Generating DDL for package ImportExport.
[2016-05-19 15:33:55] Generating DDL for package ITSMCore.
[2016-05-19 15:33:55] Generating DDL for package ITSMChangeManagement.
[2016-05-19 15:33:55] Generating DDL for package ITSMConfigurationManagement.
[2016-05-19 15:33:55] Generating DDL for package ITSMIncidentProblemManagement
[2016-05-19 15:33:55] Generating DDL for package OTRSCloneDB.
[2016-05-19 15:33:55] Generating DDL for package Support.
[2016-05-19 15:33:55] Creating structures in target database (phase 1/2)......
..............................................................................
........................................... done.
[2016-05-19 15:33:55] Converting table article...
    Inserting 1000 of 31209
    Inserting 2000 of 31209
[...]
[2016-05-19 15:36:34] Finished converting table xml_storage.
And not so successful for part 2 :

Code: Select all

[2016-05-19 15:36:34] Creating structures in target database (phase 2/2)........
................................................................................
......................DBD::mysql::db do failed: Cannot add or update a child row
: a foreign key constraint fails (`otrs`.`#sql-681_d`, CONSTRAINT `FK_article_cr
eate_by_id` FOREIGN KEY (`create_by`) REFERENCES `users` (`id`)) at C:/otrs/OTRS
/Kernel/System/DB.pm line 475.
ERROR: OTRS-otrs.CloneDB.pl-10 Perl: 5.12.3 OS: MSWin32 Time: Thu May 19 15:37:1
7 2016

 Message: Cannot add or update a child row: a foreign key constraint fails (`otr
s`.`#sql-681_d`, CONSTRAINT `FK_article_create_by_id` FOREIGN KEY (`create_by`)
REFERENCES `users` (`id`)), SQL: 'ALTER TABLE article ADD CONSTRAINT FK_article_
create_by_id FOREIGN KEY (create_by) REFERENCES users (id)'

 Traceback (3728):
   Module: Kernel::System::CloneDB::Backend::PopulateTargetStructuresPost (OTRS
3.2.9) Line: 468
   Module: otrs.CloneDB.pl (unknown version) Line: 99

.ERROR: Could not generate structures in target database!
If anyone who has faced this situation before could help me, I would be really REALLY grateful for his help.

Thanks in advance,

Jordan
Last edited by jlamarche on 24 May 2016, 14:50, edited 1 time in total.
jojo
Znuny guru
Posts: 15020
Joined: 26 Jan 2007, 14:50
Znuny Version: Git Master
Contact:

Re: Migration from OTRS 3.2.9 Windows to Linux

Post by jojo »

what database are you using. If it is mysql you don't need to convert it
"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
jlamarche
Znuny newbie
Posts: 43
Joined: 22 Nov 2013, 11:01
Znuny Version: 5.0.12
Real Name: Jordan Lamarche
Company: Smarthys

Re: Migration from OTRS 3.2.9 Windows to Linux

Post by jlamarche »

Hello,

Thank you for your fast reply, jojo.

It is indeed mysql (mariadb). So I shouldn't need CloneDB ?

If so, do I only need to copy the database and the following files ?

Code: Select all

C:/otrs/OTRS/Kernel/Config/GenericAgent.pm
C:/otrs/OTRS/Kernel/Config/Files/ZZZAuto.pm
C:/otrs/OTRS/var/article/*
C:/otrs/OTRS/var/log/TicketCounter.log
Will I get my custom fields back on the Linux setup ?

Regards,

Jordan
jojo
Znuny guru
Posts: 15020
Joined: 26 Jan 2007, 14:50
Znuny Version: Git Master
Contact:

Re: Migration from OTRS 3.2.9 Windows to Linux

Post by jojo »

yes, thats the files you need. You need to adjust the home settings and other path variables. For database just dump it.

How did you create custom fields?
"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
jlamarche
Znuny newbie
Posts: 43
Joined: 22 Nov 2013, 11:01
Znuny Version: 5.0.12
Real Name: Jordan Lamarche
Company: Smarthys

Re: Migration from OTRS 3.2.9 Windows to Linux

Post by jlamarche »

To be honest I don't know. The previous administrator did it. I just know that they are available on "notes" and I can see them on the database.
jlamarche
Znuny newbie
Posts: 43
Joined: 22 Nov 2013, 11:01
Znuny Version: 5.0.12
Real Name: Jordan Lamarche
Company: Smarthys

Re: Migration from OTRS 3.2.9 Windows to Linux

Post by jlamarche »

Hello there, I did all this but now I face a strange issue.

I have a message "Internal Server Error". Inside the Apache error_log file, this is what I see everytime I try to open http://server/otrs/index.pl :

Code: Select all

[Mon May 23 19:15:43.741695 2016] [:error] [pid 3301] mkdir /opt/otrs/var/article/2016/05/23/check_permissions_3301_371468608_1464023743_740088: Permission denied at /opt/otrs//Kernel/System/Ticket/ArticleStorageFS.pm line 44.\n
So at first I thought "Hey, that's a permission problem, so I'll just run the script written for this !" and then ran the following command :

Code: Select all

/opt/otrs/bin/otrs.SetPermissions.pl /opt/otrs --web-group=apache --otrs-group=otrs --otrs-user=otrs --web-user=otrs
bin/otrs.SetPermissions.pl - set OTRS file permissions
Copyright (C) 2001-2013 xxx, http://otrs.com/
Setting permissions on /opt/otrs
Setting permissions on /opt/otrs/var
Setting permissions on /opt/otrs/bin/*
Setting permissions on /opt/otrs/scripts/
Setting permissions on /opt/otrs/Kernel/Config.pm
No error, but still even if I restart the server I face this error message (Internal Server Error). As far as I understand, the ArticleStorageFS script cannot create the directories for the check.
So I tried to do it manually with the otrs account, and there is no error. I can do the following with the otrs user :

Code: Select all

mkdir /opt/otrs/var/article/2016/05/23/check_permissions_3301_371468608_1464023743_740088
Any help would be really appreciated.

Best regards,

Jordan
jlamarche
Znuny newbie
Posts: 43
Joined: 22 Nov 2013, 11:01
Znuny Version: 5.0.12
Real Name: Jordan Lamarche
Company: Smarthys

Re: Migration from OTRS 3.2.9 Windows to Linux

Post by jlamarche »

For testing purposes, I tried to do a chmod 777 on all /opt/otrs, but I still have the permission denied error ... Am I doing something wrong ?

Best regards,

Jordan
EXG133
Znuny expert
Posts: 217
Joined: 06 Aug 2012, 18:12
Znuny Version: 3.1.7 & 4.04

Re: Migration from OTRS 3.2.9 Windows to Linux

Post by EXG133 »

Are you sure these are all correct?
--web-group=apache --otrs-group=otrs --otrs-user=otrs --web-user=otrs
web-group on CentOS is usually httpd
jlamarche
Znuny newbie
Posts: 43
Joined: 22 Nov 2013, 11:01
Znuny Version: 5.0.12
Real Name: Jordan Lamarche
Company: Smarthys

Re: Migration from OTRS 3.2.9 Windows to Linux

Post by jlamarche »

Hello,

As far as I know, in CentOS 7 it is now "apache", but I'll give it a try to see if it is better and will keep you updated.

Thanks.
wurzel
Znuny guru
Posts: 3234
Joined: 08 Jul 2010, 22:25
Znuny Version: x.x.x
Real Name: Florian

Re: Migration from OTRS 3.2.9 Windows to Linux

Post by wurzel »

Hi,

you can try to remove the ArticleStorageFS part from ZZZAuto.pm and do a RebuildConfig
(backup ZZZAuto.pm first)

and test if it is working without ArticleStorageFS

the otrs.SetPermissions.pl should set the permissions correctly. Is your otrs user in the right groups?
Did you use the rpm for installation?
is your $OTRSHOME = /opt/otrs
?

Is your SELINUX disabled? <<- you should disable it.

Florian
OTRS 8 SILVER (Prod)
OTRS 8 auf Debian 11 (Test)
Znuny 7.x latest version testing auf Debian 11

-- Ich beantworte keine Forums-Fragen PN - No PN please

I won't answer to unfriendly users any more. A greeting and regards are just polite.
jlamarche
Znuny newbie
Posts: 43
Joined: 22 Nov 2013, 11:01
Znuny Version: 5.0.12
Real Name: Jordan Lamarche
Company: Smarthys

Re: Migration from OTRS 3.2.9 Windows to Linux

Post by jlamarche »

You're all GENIUSES, guys !

First I did as jojo told me and I got my custom fields back.
Then to prevent the error from ArticleStorageFS I just removed the line calling it from ZZZAuto.pm, just as wurzel said. Now I have everything working, I can access the index.pl URL.

I can now process to upgrade from 3.2 to 3.3, 4 and finally 5 !

A thousand thanks,

Jordan
Post Reply