OTRS auf Windows

Migration existierender Windows-Installationen nach Linux
Einführung und Vorbereitung
Downloaden Sie das OTRSCloneDB-Skript um Datenbanken zu klonen
Enable remote access for the PostgreSQL database of target system
OTRS-Dienste stoppen
Drop the existing database of your target system to have an empty database for the clone data
Get the PostgreSQL password of your database
Klonen Sie Ihre Datenbank in das Zielsystem
Copy the following files from your Windows based system to the target system
Alle Pakete erneut installieren
Disable remote access for the PostgreSQL database of your target system
OTRS-Dienste starten

OTRS kann auf einer Vielzahl von Systemplattformen betrieben werden kann, darunter Enterprise Linux, wie z. B. Red Hat Enterprise Linux, oder SuSE Linux Enterprise Server, sowie auf einer Vielzahl weiterer Linux-Derivate.

Beim Betrieb von OTRS auf Windows-Plattformen mussten wir jedoch immer wieder starke Performance-Einbußen feststellen. Diese konnten auch nach langer und intensiver Analyse aufgrund technischer Differenzen nicht zu unserer Zufriedenheit gelöst werden. Die Entwicklung unseres Windows-Installers und der OTRS Appliance haben wir aufgrund einer nun nur noch eingeschränkten Verfügbarkeit benötigter Drittkomponenten durch andere Hersteller eingestellt.

Unter diesen Bedingungen können wir keinen zukunftssicheren Betrieb von OTRS auf Windows-Plattformen garantieren und empfehlen daher die Migration auf eine der oben genannten Linux-Plattformen oder den Einsatz unserer OTRS Business Solution™ Managed.

Wir möchten Ihnen die Migration von Windows auf Linux erleichtern und Ihnen damit die beste Performance von OTRS bieten. Daher haben wir hier eine detaillierte Anleitung für Sie zusammengestellt.

Migration existierender Windows-Installationen nach Linux

Einführung und Vorbereitung

If you have a Windows based installation and you would like to change to a Linux based system you will need to setup a Linux server or virtual machine and install OTRS there (see the installation instructions). This will be the target system for the migration.

Downloaden Sie das OTRSCloneDB-Skript um Datenbanken zu klonen

Please go to the admin menu of the Windows based system and install the newest version of OTRSCloneDB package into your OTRS:

Sie können das OTRSCloneDB-Paket direkt aus dem Paket-Manager installieren. Wählen Sie "OTRS Extensions" aus der Dropdown-Liste auf der linken Seite aus und klicken Sie auf den Button "Verzeichnis aktualisieren". Das Paket OTRSCloneDB wird dann in einer Liste angezeigt, klicken Sie dann auf "Installieren".

You could also download the package manually from the OTRS FTP server and install the package manually as described below. http://ftp.otrs.org/pub/otrs/packages/

Downloaden Sie das Paket mit der höchsten Versionsnummer:

OTRSCloneDB-1.0.13.opm
                

Abbildung 2.10. Download des OTRSCloneDB-Skript - Screenshot

Download des OTRSCloneDB-Skript - Screenshot


and install it to your Windows based installation:

Abbildung 2.11. Installieren des OTRSCloneDB-Skripts - Screenshot

Installieren des OTRSCloneDB-Skripts - Screenshot


It is also no problem if you have installed some additional features or custom developments on your OTRS. You just need to take care that all of your installed packages are also compatible with Unix based systems. For packages provided by OTRS this is the case.

Enable remote access for the PostgreSQL database of target system

The OTSRCloneDB script will copy the database data over the network, so we need to enable remote access to the database. The setup is different for the different databases, we will describe opening remote access for a PostgreSQL database here.

After logging into your target system via SSH you need to change into the postgresql directory:

Shell> cd /etc/postgresql/9.4/main
Shell> vi postgresql.conf
                

Fügen Sie folgende Zeile am Ende der Datei hinzu:

listen_addresses = '*'
                

Speichern Sie die Datei.

Shell> vi pg_hba.conf
                

Fügen Sie folgende Zeile am Ende der Datei hinzu:

host all all  0.0.0.0/0 md5
                

Speichern Sie die Datei.

Restart your PostgreSQL server:

Shell> service postgresql restart
                

OTRS-Dienste stoppen

Stop all running services of your target system:

shell> service cron stop
shell> service apache2 stop
shell> su - otrs
shell> cd /opt/otrs/
shell> bin/Cron.sh stop
shell> bin/otrs.Daemon.pl -a stop
shell> exit
                

Drop the existing database of your target system to have an empty database for the clone data

The OTRSCloneDB script will not remove the data in the existing otrs database of the target system, so we need to do this manually:

Change the user to the postgresql user:

Shell> su - postgres
                

Drop the existing otrs database:

Shell> dropdb otrs
                

Create a new otrs database for the otrs user:

Shell> createdb --owner=otrs --encoding=utf8 otrs
                

Go back to root user:

Shell> exit
                

Get the PostgreSQL password of your database

Change into the OTRS directory of your target system:

Shell> cd /opt/otrs
                

and take a look at the configuration file of your target system:

Shell> less Kernel/Config.pm
                

Sie finden das Datenbank-Passwort, wenn Sie ein wenig scrollen:

Abbildung 2.12. Zieldatenbankpasswort holen - Bildschirmfoto

Zieldatenbankpasswort holen - Bildschirmfoto


In unserem Beispiel:

I88cm34A1B6xrl3
                

Write the password down on a piece of paper.

Klonen Sie Ihre Datenbank in das Zielsystem

Switch back to your Windows based installation and open the SysConfig admin menu. Please select the group "OTRSCloneDB" and the subgroup "Configuration":

Abbildung 2.13. Konfiguration der OTRSCloneDB Sysconfig 1 - screenshot

Konfiguration der OTRSCloneDB Sysconfig 1 - screenshot


Sie müssen in der SysConfig die Option OTRSCloneDB::TargetSettings mit den folgenden Werten konfigurieren:

TargetDatabaseHost => 192.168.137.20 (Here you need to enter the ip address of your target system)
TargetDatabase => otrs
TargetDatabaseUser => otrs
TargetDatabasePw => I88cm34A1B6xrl3 (Here you need to set the password of your target system)
TargetDatabaseType => postgresql
                

Abbildung 2.14. Konfiguration der OTRSCloneDB Sysconfig 2 - screenshot

Konfiguration der OTRSCloneDB Sysconfig 2 - screenshot


To run the OTRSCloneDB script we need to switch to the command prompt of our Windows based OTRS and to change into the base directory of our OTRS installation:

Shell> cd "C:\otrs"
                

If you are using StrawberryPerl, then you maybe need to activate your shell for Perl:

Shell> StrawberryPerl\portableshell.bat
                

Abbildung 2.15. Ausführen des OTRSCloneDB-Skript 1 - screenshot

Ausführen des OTRSCloneDB-Skript 1 - screenshot


The OTRSCloneDB script is located in the bin directory of the OTRS directory.

Shell> cd "OTRS\bin"
                

Führen Sie das OTRSCloneDB-Skript aus:

shell> perl otrs.CloneDB.pl
                

Nun sollten Sie einige Informationen und Parameter des Skriptes sehen.

Abbildung 2.16. Run OTRSCloneDB script 2 - screenshot

Run OTRSCloneDB script 2 - screenshot


Anmerkung... Fehler die während einer Ausführung ohne Parameter auftreten, können mit falschen Login-Daten für die Datenbank oder mit Problemen in der Datenbankverbindung zusammenhängen.

If no errors occurred, check if the dry run is successful:

shell> perl otrs.CloneDB.pl -n
                

Abbildung 2.17. Run OTRSCloneDB script 3 - screenshot

Run OTRSCloneDB script 3 - screenshot


Starten Sie das Klonen der Datenbank:

shell> perl otrs.CloneDB.pl -r
                

Ein Beispiel für eine erfolgreiche Migration sieht wie folgt aus:

Generating DDL for OTRS.
Generating DDL for package OTRSCloneDB.
Creating structures in target database (phase 1/2)
...
...
Creating structures in target database (phase 2/2)
...
done.
                

Copy the following files from your Windows based system to the target system

You need to copy some files from your Windows based system to the target system. You can do this for example with a free tool like "WinSCP" (just search the internet for "WinSCP"). Copy the following files from your Windows based system:

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
                

zu Ihrem Zielsystem:

/opt/otrs/Kernel/Config/GenericAgent.pm
/opt/otrs/Kernel/Config/Files/ZZZAuto.pm
/opt/otrs/var/article/*
/opt/otrs/var/log/TicketCounter.log
                

Open the file /opt/otrs/Kernel/Config/Files/ZZZAuto.pm on the target system and replace all paths like "C:/otrs/OTRS/" with "/opt/otrs/"!

If you have have manually changes in your Kernel/Config.pm then please copy these changes to the target system's Kernel/Config.pm. Don't copy it 1:1 because you will now have different database settings and the file paths on the target system are different from Windows!

Alle Pakete erneut installieren

Reinstall all packages with the package manager to get all custom files back.

shell> bin/otrs.SetPermissions.pl --otrs-user=otrs --otrs-group=otrs --web-user=www-data --web-group=www-data /opt/otrs
shell> su - otrs
shell> cd /opt/otrs
shell> perl bin/otrs.Console.pl Maint::Cache::Delete
shell> perl bin/otrs.Console.pl Maint::Loader::CacheCleanup
shell> perl bin/otrs.Console.pl Admin::Package::ReinstallAll
shell> exit
                

Setzen Sie alle Berechtigungen in Ihrem OTRS-System erneut:

shell> bin/otrs.SetPermissions.pl --otrs-user=otrs --otrs-group=otrs --web-user=www-data --web-group=www-data /opt/otrs
                

Disable remote access for the PostgreSQL database of your target system

Undo all steps you did to enable the remote access for the PostgreSQL database to your target system.

Wechseln Sie in das PostgreSQL-Verzeichnis:

Shell> cd /etc/postgresql/9.4/main
Shell> vi postgresql.conf
                

Entfernen Sie die folgenden Zeilen am Ende der Datei:

listen_addresses = '*'
                

Speichern Sie die Datei.

Shell> vi pg_hba.conf
                

Entfernen Sie die folgenden Zeilen am Ende der Datei:

host all all  0.0.0.0/0 md5
                

Speichern Sie die Datei.

Starten Sie Ihren postgresql-Server neu

Shell> service postgresql restart
                

OTRS-Dienste starten

Starten Sie Dienste auf Ihrem Zielsystem:

shell> service cron start
shell> service apache2 start
shell> su - otrs
shell> cd /opt/otrs/
shell> bin/Cron.sh start
shell> bin/otrs.Daemon.pl -a start
                

Now you should be able to open the OTRS of your target system in the browser with the imported data of your Windows based system.