[otrs] Migrate OTRS from windows to linux.

874 views
Skip to first unread message

Israel Garcia

unread,
Aug 20, 2012, 10:06:54 AM8/20/12
to ot...@otrs.org
Hello

First, I have searched a lot on how to make this but no success.

We want to migrate our lovely OTRS 3.0 from a windows server to a new CentOS 6 linux server. I have installed the same version of OTRS (3.0) on the linux side as well as the same version of iTSM. Both servers has the same version of OTRS's software.

I have made a dump of the database on the windows side to a sql file. But, not sure if I have to:

- Drop database on the linux side and import the sql file from the windows server.
- Overwrite this files in the linux server.
  • Kernel/Config.pm
  • Kernel/Config/GenericAgent.pm
  • Kernel/Config/Files/ZZZAuto.pm
  • var/*
- Export Setting on ADMIN/SysConfig TAB on the windows and imported on the ADMIN/SysConfig TAB on the linux side.

Is it enough to make the migration?

Thanks much!

Regards
Israel.

Martin Gruner

unread,
Aug 21, 2012, 3:18:43 AM8/21/12
to Israel Garcia, User questions and discussions about OTRS.
Hi Israel,

your proposal sounds good.

Am 20.08.12 16:06, schrieb Israel Garcia:
I have made a dump of the database on the windows side to a sql file. But, not sure if I have to:

- Drop database on the linux side and import the sql file from the windows server.
Yes.

- Overwrite this files in the linux server.
  • Kernel/Config.pm
  • Kernel/Config/GenericAgent.pm
  • Kernel/Config/Files/ZZZAuto.pm
  • var/*
Yes.

- Export Setting on ADMIN/SysConfig TAB on the windows and imported on the ADMIN/SysConfig TAB on the linux side.
That should not be needed because you already did that in the step above.

If you run otrs.RebuildConfig.pl and otrs.DeleteCache.pl, things should be fine. Let us know how you get along!

Best regards, mg
-- 
Martin Gruner
Senior Developer R&D

OTRS AG
Europaring 4
94315 Straubing

T: +49 (0)6172 681988 0
F: +49 (0)9421 56818 18
I:  www.otrs.com/

Geschäftssitz: Bad Homburg, Amtsgericht: Bad Homburg, HRB 10751, USt-Nr.: DE256610065
Aufsichtsratsvorsitzender: Burchard Steinbild, Vorstand: André Mindermann (Vorsitzender), Christopher Kuhn, Sabine Riedel

Verbinden wir uns! OTRS 3.1 schafft einfachere Integration mit Drittapplikationen – Für Frühbucher zum Vorzugspreis: http://www.otrs.com/index.php?id=2361&L=1

Israel Garcia

unread,
Aug 21, 2012, 3:46:07 AM8/21/12
to Martin Gruner, User questions and discussions about OTRS.
Hi Martin, really appreciate your time to respond my email. I'll migrate soon and I'll let the list know if it was successful or not. Will also try to send a step by step tutorial.

Thanks much!


De: Martin Gruner <martin...@otrs.com>
Para: Israel Garcia <iga...@yahoo.com>; User questions and discussions about OTRS. <ot...@otrs.org>
Enviado: Martes 21 de agosto de 2012 9:18
Asunto: Re: [otrs] Migrate OTRS from windows to linux.

Israel Garcia

unread,
Aug 21, 2012, 4:57:29 AM8/21/12
to Martin Gruner, User questions and discussions about OTRS.

Hi  Martin,

Have just started the migration ;)

What do you mean by "If you run otrs.RebuildConfig.pl and otrs.DeleteCache.pl, things should be fine"?.

 Do I have to run this two scripts on the linux side after finished all steps we have talked about?

Thanks in advance...
Israel.

Steven Carr

unread,
Aug 21, 2012, 5:40:24 AM8/21/12
to Israel Garcia, User questions and discussions about OTRS.
Yes, run those on the Linux side of things before you try to connect
to OTRS and it will ensure the config is OK and any old sessions are
removed from the database.

Steve

> ---------------------------------------------------------------------
> OTRS mailing list: otrs - Webpage: http://otrs.org/
> Archive: http://lists.otrs.org/pipermail/otrs
> To unsubscribe: http://lists.otrs.org/cgi-bin/listinfo/otrs
---------------------------------------------------------------------
OTRS mailing list: otrs - Webpage: http://otrs.org/
Archive: http://lists.otrs.org/pipermail/otrs
To unsubscribe: http://lists.otrs.org/cgi-bin/listinfo/otrs

Israel Garcia

unread,
Aug 21, 2012, 5:43:24 AM8/21/12
to Steven Carr, User questions and discussions about OTRS.
Perfect!!

Thanks much.


De: Steven Carr <sjc...@gmail.com>

Para: Israel Garcia <iga...@yahoo.com>; User questions and discussions about OTRS. <ot...@otrs.org>
Enviado: Martes 21 de agosto de 2012 11:40

Asunto: Re: [otrs] Migrate OTRS from windows to linux.

Israel Garcia

unread,
Aug 21, 2012, 5:50:21 AM8/21/12
to Steven Carr, User questions and discussions about OTRS.
Hi Steve,

I have done all steps talked in this thread but when run this two scripts see he error:

[root@otrs2 var]# /opt/otrs/bin/otrs.RebuildConfig.pl
ERROR: Can't read C:/ARCHIV~1/OTRS/OTRS/RELEASE: No such file or directory This file is needed by central system parts of OTRS, the system will not work without this file.
Died at /opt/otrs/Kernel/Config/Defaults.pm line 2183.

[root@otrs2 var]# /opt/otrs/bin/otrs.DeleteCache.pl
ERROR: Can't read C:/ARCHIV~1/OTRS/OTRS/RELEASE: No such file or directory This file is needed by central system parts of OTRS, the system will not work without this file.
Died at /opt/otrs/Kernel/Config/Defaults.pm line 2183.

I think it's reading a file from the windows server... any idea on how to solve this...

Thanks tons..


De: Steven Carr <sjc...@gmail.com>
Para: Israel Garcia <iga...@yahoo.com>; User questions and discussions about OTRS. <ot...@otrs.org>
Enviado: Martes 21 de agosto de 2012 11:40
Asunto: Re: [otrs] Migrate OTRS from windows to linux.

Steven Carr

unread,
Aug 21, 2012, 6:02:03 AM8/21/12
to User questions and discussions about OTRS.
So in the /opt/otrs/Kernel/Config/Defaults.pm file you must have some
filesystem references from the Windows system. You will need to go
through the file and update them to the linux paths.

For what it's worth, Kernel/Config/Defaults.pm should *never* be
edited (it does say so at the top of the file, though yes even I have
manually edited things in this as it's easier than trying to figure
out how to put part of an array into Kernel/Config.pm - just means you
have to watch out on upgrades incase your custom options get wiped
out).

So I would probably grab a fresh copy of the Kernel/Config/Defaults.pm
from the OTRS source bundle, then do a diff and see what you have in
yours that is different to the source one.

Steve



On 21 August 2012 10:50, Israel Garcia <iga...@yahoo.com> wrote:
> Hi Steve,
>
> I have done all steps talked in this thread but when run this two scripts
> see he error:
>
> [root@otrs2 var]# /opt/otrs/bin/otrs.RebuildConfig.pl
> ERROR: Can't read C:/ARCHIV~1/OTRS/OTRS/RELEASE: No such file or directory
> This file is needed by central system parts of OTRS, the system will not
> work without this file.
> Died at /opt/otrs/Kernel/Config/Defaults.pm line 2183.
>
> [root@otrs2 var]# /opt/otrs/bin/otrs.DeleteCache.pl
> ERROR: Can't read C:/ARCHIV~1/OTRS/OTRS/RELEASE: No such file or directory
> This file is needed by central system parts of OTRS, the system will not
> work without this file.
> Died at /opt/otrs/Kernel/Config/Defaults.pm line 2183.
>
> I think it's reading a file from the windows server... any idea on how to
> solve this...
>
> Thanks tons..
>

Israel Garcia

unread,
Aug 21, 2012, 6:46:04 AM8/21/12
to Steven Carr, ot...@otrs.org
Thanks Steve, it's working now... I'm going to make some tests and if it's OK, and I'll send the list the steps I used for this migration, maybe it's useful for other people in the future..;)


De: Steven Carr <sjc...@gmail.com>
Para: Israel Garcia <iga...@yahoo.com>
Enviado: Martes 21 de agosto de 2012 12:01

Asunto: Re: [otrs] Migrate OTRS from windows to linux.

So in the /opt/otrs/Kernel/Config/Defaults.pm file you must have some
filesystem references from the Windows system. You will need to go
through the file and update them to the linux paths.

For what it's worth, Kernel/Config/Defaults.pm should *never* be
edited (it does say so at the top of the file, though yes even I have
manually edited things in this as it's easier than trying to figure
out how to put part of an array into Kernel/Config.pm - just means you
have to watch out on upgrades incase your custom options get wiped
out).

So I would probably grab a fresh copy of the Kernel/Config/Defaults.pm
from the OTRS source bundle, then do a diff and see what you have in
yours that is different to the source one.

Steve

Martin Gruner

unread,
Aug 21, 2012, 7:12:57 AM8/21/12
to User questions and discussions about OTRS.
Hi Steven and Israel,

don't edit Defaults.pm. Just make the changes that cannot be done with
AdminSysConfig in Kernel/Config.pm. This file will never be overwritten
by a system update.

Regards, mg

Am 21.08.12 12:02, schrieb Steven Carr:
--
Martin Gruner
Senior Developer R&D

OTRS AG
Europaring 4
94315 Straubing

T: +49 (0)6172 681988 0
F: +49 (0)9421 56818 18
I: www.otrs.com/

Geschäftssitz: Bad Homburg, Amtsgericht: Bad Homburg, HRB 10751, USt-Nr.: DE256610065
Aufsichtsratsvorsitzender: Burchard Steinbild, Vorstand: André Mindermann (Vorsitzender), Christopher Kuhn, Sabine Riedel

Verbinden wir uns! OTRS 3.1 schafft einfachere Integration mit Drittapplikationen – Für Frühbucher zum Vorzugspreis: http://www.otrs.com/index.php?id=2361&L=1

Steven Carr

unread,
Aug 21, 2012, 8:01:39 AM8/21/12
to User questions and discussions about OTRS.
Yep, like I commented it's easier to make a single line change to the
Defaults.pm file than to copy a whole array structure into Config.pm
and then risk losing "new" functionality when the array in Defaults.pm
is updated. I have a diff file which I use to reapply only the changes
I made.

In particular the option that I modified was to enable the Customer
Company functionality - adding UserCompanyID into the
$Self->{CustomerUser} => Map[] variable. Would be nice if this
functionality was just added into the code permanently, not sure why
it isn't in there with an option in SysConfig to simply enable/disable
it.

Steve

Martin Gruner

unread,
Aug 21, 2012, 8:24:33 AM8/21/12
to User questions and discussions about OTRS.
Hi Steve,

I think Perl supports this out of the box. :D
Try something like:

push @{$Self->{CustomerUser}->{Map}}, [ your additional settings here ... ];

Best regards, mg


Am 21.08.12 14:01, schrieb Steven Carr:

Steven Carr

unread,
Aug 21, 2012, 8:43:24 AM8/21/12
to User questions and discussions about OTRS.
It probably does but at the time my brain wasn't in the mood to figure
it out lol (might be worth updating the OTRS documentation on how to
correctly edit the Config.pm file though) ;)

Steve



On 21 August 2012 13:24, Martin Gruner <martin...@otrs.com> wrote:
> Hi Steve,
>
> I think Perl supports this out of the box. :D
> Try something like:
>
> push @{$Self->{CustomerUser}->{Map}}, [ your additional settings here ... ];
>
> Best regards, mg
>
>

Israel Garcia

unread,
Aug 21, 2012, 10:40:11 AM8/21/12
to User questions and discussions about OTRS.
OK, As I promised here is what I did to migrate OTRS v3.0.11 from a windows to a Centos linux box.

FIRST: This worked for me, it's not an official tutorial neither approved by OTRS team. Use it at your own risk.  ;)

Before migration:
OTRS v3.0.11 running on a windows XP box.

Goal:
Migrate the same version to a linux box maintaining all data as in the windows server.

Steps to migrate same version 3.0.11 from the window to linux.
- Install a fresh CentOS 6.3 with all updates.

- Install OTRS v 3.0.11 following this URL:  http://www.blog.paranoidpenguin.net/2012/04/how-to-install-otrs-3-1-on-centos-6-2-part-2/ but using v 3.0.11 instead 3.1.3, also I used postfix instead sendmail.

- versions of some software:
    [root@otrs2 sys]# rpm -qa|grep otrs
    otrs-3.0.11-03.noarch
   
    [root@otrs2 sys]# rpm -qa|grep httpd
    httpd-2.2.15-15.el6.centos.1.i686
    httpd-tools-2.2.15-15.el6.centos.1.i686
   
    [root@otrs2 sys]# rpm -qa|grep mysql
    mysql-libs-5.1.61-4.el6.i686
    php-mysql-5.3.3-14.el6_3.i686
    mysql-5.1.61-4.el6.i686
    mysql-server-5.1.61-4.el6.i686
   
    [root@otrs2 sys]# rpm -qa|grep perl
    perl-5.10.1-127.el6.i686

- Backup to MYSQL database on Windows.
    C:\>"C:\Archivos de programa\OTRS\mysql\bin\mysqldump.exe" -uroot -p otrs > otrsbk.sql

-Copied these files to my PC for copying later to the  linux box:
    Kernel/Config.pm
    Kernel/Config/GenericAgent.pm
    Kernel/Config/Files/ZZZAuto.pm
    var/*

- OPTIONAL: make a backup of MYSQL database on the linux side before being deleted.
    [root@otrs2 init.d]# mysqldump -u root -p otrs >/tmp/otrs_original_antes_migracion.sql
    Enter password:

- DROP database on the linux side stopping first all daemons regarding OTRS (httpd, crond, postfix)
    CRON
    [root@otrs2 init.d]# service crond stop
    Stopping crond:                                            [  OK  ]

    APACHE
    [root@otrs2 init.d]# service httpd stop
    Stopping httpd:                                            [  OK  ]

    POSTFIX
    [root@otrs2 init.d]# service postfix stop
   
    [root@otrs2 init.d]# mysql -uroot -p
    Enter password:
    Welcome to the MySQL monitor.  Commands end with ; or \g.
    Your MySQL connection id is 4
    Server version: 5.1.61 Source distribution

    Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.

    Oracle is a registered trademark of Oracle Corporation and/or its
    affiliates. Other names may be trademarks of their respective
    owners.

    Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

    mysql> show databases;
    +--------------------+
    | Database           |
    +--------------------+
    | information_schema |
    | mysql              |
    | otrs               |
    +--------------------+
    3 rows in set (0.00 sec)

    mysql> drop database otrs;
    Query OK, 111 rows affected (0.10 sec)

    mysql> exit
    Bye
    [root@otrs2 init.d]#                  

- Copy otrsbk,sql file, create new database and import the MYSQL-Windows file in the linux box.
    Copy otrsbk.sql to linux:/tmp/
       
    [root@otrs2 init.d]# mysqladmin -u root -p create otrs
    Enter password:
   
    [root@otrs2 init.d]#  mysql -u otrs -p otrs < /tmp/otrsbk.sql
    Enter password:
   
- Stop all services on the linux box regarding OTRS.
    CRON
    [root@otrs2 init.d]# service crond stop
    Stopping crond:                                            [  OK  ]

    APACHE
    [root@otrs2 init.d]# service httpd stop
    Stopping httpd:                                            [  OK  ]

    MYSQL
    [root@otrs2 init.d]# service mysqld stop
    Stopping mysqld:                                           [  OK  ]

    POSTFIX
    [root@otrs2 init.d]# service postfix stop
    Shutting down postfix:                                     [  OK  ]
       
- Copy these files and folders from my PC to the linux BOX. (NOTE: Recommended to verify all permissions on the copied files before continue)
    Kernel/Config.pm
    Kernel/Config/GenericAgent.pm
    Kernel/Config/Files/ZZZAuto.pm
    var/*

- Replaced this string "/ARCHIV~1/OTRS/OTRS/"  for this one "/opt/otrs" on these files:
    /opt/otrs/Kernel/Config.pm
    /opt/otrs/Kernel/Config/Files/ZZZAuto.pm
   
- Check if database's "otrs" password is the same on the linux box editing this file /opt/otrs/Kernel/Config.pm
    # (The password of database user. You also can use bin/CryptPassword.pl
    # for crypted passwords.)
    $Self->{'DatabasePw'} = 'otrs-password';


- Execute this two scripts:
   
    [root@otrs2 Config]# /opt/otrs/bin/otrs.RebuildConfig.pl
    otrs.RebuildConfig.pl <Revision 1.14> - OTRS rebuild default config
    Copyright (C) 2001-2010 OTRS AG, http://otrs.org/

    [root@otrs2 Config]# /opt/otrs/bin/otrs.DeleteCache.pl

- Start all daemons:
    CRON
    [root@otrs2 init.d]# service crond start
    Stopping crond:                                            [  OK  ]

    APACHE
    [root@otrs2 init.d]# service httpd start
    Stopping httpd:                                            [  OK  ]

    MYSQL
    [root@otrs2 init.d]# service mysqld start
    Stopping mysqld:                                           [  OK  ]

    POSTFIX
    [root@otrs2 init.d]# service postfix start
    Shutting down postfix:                                     [  OK  ]

- Setup email/pop3 on the linux side to send/receive mails for tickets.

Hope it helps someone ;)

See ya!


De: Steven Carr <sjc...@gmail.com>
Para: User questions and discussions about OTRS. <ot...@otrs.org>
Enviado: Martes 21 de agosto de 2012 14:43

Asunto: Re: [otrs] Migrate OTRS from windows to linux.
Reply all
Reply to author
Forward
0 new messages