OTRS の 3.3 から 4 へのアップグレード

これらの手順は、OTRSを3.3から4へアップグレード、及び4以降のパッチレベルリリースの4へアップグレードする人々に向けた説明です。RPMとソースコード(tarball)のアップグレードの両方に適用されます。

あなたがOTRSの下位バージョンを実行している場合は、3.3の最初の(1.1->1.2->1.3->2.0->2.1->2.2->2.3->2.4>3.0->3.1->3.2->3.3)アップグレードパスに従わなければなりません! あなたは、データベースの変更とアップグレードのperlスクリプトを含む、その間のすべてのバージョンへの完全アップグレードを実行する必要があります。

OTRS2.2またはそれ以前からアップグレードする場合、あなたは余分なステップを取らなければならないことに注意してください。

単一のマイナーバージョンの中で、あなたがアップグレードする場合、パッチレベルリリースをスキップすることができます。あなたは、このような「パッチレベルのアップグレード」を行う必要がある場合たとえば、あなたは手順6、11、13および14をスキップする必要があり、バージョン4パッチレベル6に直接OTRS4パッチレベル2からアップグレードすることができます。

最初に独立した試験機でのテスト·アップデートを実行することを強くお勧めします。

Step 1: 関連するすべてのサービスを停止します。

OTRSにアクセスしようとする複数の実行中のサービスやcronジョブがないことを確認してください。これはあなたのサービスの構成に依存し、これは一例です。

shell> /etc/init.d/cron stop
shell> /etc/init.d/postfix stop
shell> /etc/init.d/apache stop
            

OTRS cronジョブとスケジューラを(この順序で)停止します。

shell> cd /opt/otrs/
shell> bin/Cron.sh stop
shell> bin/otrs.Scheduler.pl -a stop
            

Step 2: /opt/otrs/ 配下の全てをバックアップしてください。

  • Kernel/Config.pm

  • Kernel/Config/GenericAgent.pm

  • Kernel/Config/Files/ZZZAuto.pm

  • var/*

  • データベースも同様に行います。

Step 3: 全てを確実にバックアップしたことを確認してください。 ;-)

Step 4: 新しいリリースをインストールします。 (tar や RPM)

Step 4.1: tarball を使う場合:

shell> cd /opt
shell> mv otrs otrs-old
shell> tar -xzf otrs-x.x.x.tar.gz
shell> mv otrs-x.x.x otrs
            
旧構成ファイルをリストア

  • Kernel/Config.pm

  • Kernel/Config/GenericAgent.pm

  • Kernel/Config/Files/ZZZAuto.pm

TicketCounter.logをリストア

In order to let OTRS continue with the correct ticket number, restore the TicketCounter.log to /opt/otrs/var/log/. This is especially important if you use incremental ticketnumbers.

記事データのリストア

If you configured OTRS to store article data in the filesystem you have to restore the article folder to /opt/otrs/var/.

Set file permissions

Please execute

shell> cd /opt/otrs/
shell> bin/otrs.SetPermissions.pl
                

with the permissions needed for your system setup. For example:

  • Web server which runs as the OTRS user:

    shell> bin/otrs.SetPermissions.pl --web-group=otrs
                    

  • Webserver with wwwrun user (e. g. SUSE):

    shell> bin/otrs.SetPermissions.pl --web-group=wwwrun
                    

  • Webserver with apache user (e. g. Red Hat, CentOS):

    shell> bin/otrs.SetPermissions.pl --web-group=apache
                    

  • Webserver with www-data user (e. g. Debian, Ubuntu):

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

Step 4.2: With the RPM:

shell> rpm -Uvh otrs-x.x.x.-01.rpm
            

In this case the RPM update automatically restores the old configuration files and sets file permissions.

Step 5: Check needed Perl modules

システムに必要とされるperlモジュールがすべてインストールされ不足しているおそれのあるモジュールをインストールすることを確認してください。

shell> /opt/otrs/bin/otrs.CheckModules.pl
        

Step 6: Apply the database changes

Step 6.1: Database schema update

MySQL:

Note: new tables created in the MySQL UPGRADING process will be created with the default table storage engine set in your MySQL server. In MySQL 5.5 the new default type is InnoDB. If existing tables, e.g. "users", have the table storage engine e.g. MyISAM, then an error will be displayed when creating the foreign key constraints.

You have two options: you can change the default storage engine of MySQL back to MyISAM so that new tables will have the same engine as the existing tables, or change the existing tables to use InnoDB as storage engine.

Any problems with regards to the storage engine will be reported by the otrs.CheckDB.pl script, so please run it to check for possible issues.

shell> cd /opt/otrs/
shell> bin/otrs.CheckDB.pl
shell> cat scripts/DBUpdate-to-4.mysql.sql | mysql -p -f -u root otrs
                

PostgreSQL:

shell> cd /opt/otrs/
shell> cat scripts/DBUpdate-to-4.postgresql.sql | psql --set ON_ERROR_STOP=on --single-transaction otrs otrs
                

Step 6.2: Database migration script

Run the migration script (as user otrs, NOT as root):

shell> scripts/DBUpdate-to-4.pl
            

Do not continue the upgrading process if this script did not work properly for you. Otherwise data loss may occur.

Step 7: Own themes

Note: The OTRS themes of 3.3 are NOT compatible with OTRS 4, so don't use your old themes!

Themes are located under /opt/otrs/Kernel/Output/HTML/*/*.tt.

Please note that OTRS 4 comes with a new templating engine based on Template::Toolkit. All customized templates must be converted from DTL to the new format. Please see the development manual for detailed instructions.

Step 8: Refresh the configuration cache and delete caches

Please run (as user otrs, not as root):

shell> bin/otrs.RebuildConfig.pl
shell> bin/otrs.DeleteCache.pl
        

Step 9: Restart your services

例えば(ご使用中のサービスによりますが)

shell> /etc/init.d/apache start
shell> /etc/init.d/postfix start
shell> /etc/init.d/cron start
        

今、システムにログインできます。

Step 10: Check installed packages

注記

The OTRS packages of 3.3 are NOT compatible with OTRS 4, so you have to perform a package upgrade!

以下のパッケージはアップグレード・プロセス後。自動的にアンインストールされます(先にインストール済ならば)

  • OTRSGenericInterfaceREST

  • OTRSMyServices

  • OTRSStatsRestrictionByDateTimeDF

  • Support

Step 11: Check GenericAgent jobs

If you have any GenericAgent jobs (or even any custom developments) that automatically set ProcessID or ActivityID dynamic fields, you need to update these to set the fields to the new long EntityIDs that were generated by DBUpdate-to-4.pl.

Step 12: Update and activate cronjobs

There are several OTRS default cronjobs in /opt/otrs/var/cron/*.dist. They can be activated by copying them without the ".dist" filename extension. Do this to make sure you get the latest versions of the cronjobs and new cronjobs as well.

shell> cd /opt/otrs/var/cron
shell> for foo in *.dist; do cp $foo `basename $foo .dist`; done
            

Please check the copied files and re-apply any customizations that you might have made. To schedule these cronjobs on your system, you can use the script Cron.sh. Make sure to execute it as the otrs user!

shell> /opt/otrs/bin/Cron.sh start
            

This will also cause the OTRS Scheduler to be started.

Step 13: Update Customer database configuration

If you're using an external customer database and this database does NOT provide the OTRS specific fields create_time, create_by, change_time and change_by, please set ForeignDB => 1 for $Self->{CustomerUser} and $Self->{CustomerCompany} (see Kernel/Config/Defaults.pm).

Step 14: Rebuild Ticket index

Please run bin/otrs.RebuildTicketIndex.pl to regenerate the ticket index. This can be done in the background to calculate the ticket numbers for the queue view screens. You can already use your system.

Step 14: Well done!