Обновление OTRS-фреймворка

These instructions are for people upgrading OTRS from version 3.2 to 3.3, and apply both for RPM and source code (tarball) upgrades.

Примечание

Please note that OTRS 3.3 requires at least perl version 5.10.0. Make sure before you plan your upgrade that your server runs this version. You can check the version with the command perl -v on the command line.The only known Linux distribution that uses perl 5.8 and is still supported by its vendor is Red Hat Enterprise Linux (RHEL) 5 and its community supported derivative CentOS 5. If you're on any of these platforms and you plan to upgrade to OTRS 3.3 you should also plan migrating your operating system to a version with a supported perl, such as RHEL 6 or CentOS 6.

If you are running a lower version of OTRS you have to follow the upgrade path to 3.1 first (1.1->1.2->1.3->2.0->2.1->2.2->2.3->2.4->3.0->3.1->3.2->3.3 ...)! You need to perform a full upgrade to every version in between, including database changes and the upgrading perl script.

Please note that if you upgrade from OTRS 2.2 or earlier, you must take an extra step; please read http://bugs.otrs.org/show_bug.cgi?id=6798.

Within a single minor version you can skip patch level releases if you want to upgrade. For instance you can upgrade directly from OTRS 3.3.1 to version 3.3.4. If you need to do such a "patch level upgrade", you should skip steps 9 and 13-17.

  1. Остановите все соответствующие службы.

    в т.ч. (зависящие от использующихся услуг):

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

  2. Сделайте резервные копии всех данных из $OTRS_HOME (по умолчанию OTRS_HOME=/opt/otrs):

    • Kernel/Config.pm

    • Kernel/Config/GenericAgent.pm

    • Kernel/Config/Files/ZZZAuto.pm

    • var/*

    • а также базу данных

  3. Убедитесь, что вы создали резервную копию всех данных ;-)

  4. Установить новую систему (опционально)

    Если есть возможность, сначала попробуйте произвести установку на отдельном тестовом компьютере.

  5. Установка нового релиза (из tar-архива или с помощью RPM-пакетов).

    • С помощью тарбола (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
                      

      Restore old configuration files

      • Kernel/Config.pm

      • Kernel/Config/GenericAgent.pm

      • Kernel/Config/Files/ZZZAuto.pm

      Restore TicketCounter.log

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

      Restore article data

      If you configured OTRS to store article data in the filesystem you have to restore the article folder to $OTRS_HOME/var/ (default: OTRS_HOME=/opt/otrs).

    • С помощью RPM-пакетов:

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

      В этом случае обновление из RPM автоматически восстанавливает старые конфигурационные файлы.

  6. Собственные темы

    Note: The OTRS themes between 3.2 and 3.3 are NOT compatible, so don't use your old themes!

    Темы хранятся в $OTRS_HOME/Kernel/Output/HTML/*/*.dtl (default: OTRS_HOME=/opt/otrs).

    Please also note that dtl-Files must be in utf-8 from OTRS 3.3 on.

  7. Установка прав доступа к файлам.

    В случае использования тарбола (tarball), выполните

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

    с правами, необходимыми для установки системы.

  8. Check needed Perl modules

    Verify that all needed perl modules are installed on your system and install any modules that might be missing.

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

  9. Схема обновления:

    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: (1) 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 (2) 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/
    
    # MySQL:
    shell> bin/otrs.CheckDB.pl
    shell> cat scripts/DBUpdate-to-3.3.mysql.sql | mysql -p -f -u root otrs
    
    # PostgreSQL 8.2+:
    shell> cat scripts/DBUpdate-to-3.3.postgresql.sql | psql --set ON_ERROR_STOP=on --single-transaction otrs otrs
    
    # PostgreSQL, older versions:
    shell> cat scripts/DBUpdate-to-3.3.postgresql_before_8_2.sql | psql --set ON_ERROR_STOP=on --single-transaction otrs otrs
                

    Note: If you use PostgreSQL 8.1 or earlier, you need to activate the new legacy driver for these older versions. Do this by adding a new line to your Kernel/Config.pm like this:

    $Self->{DatabasePostgresqlBefore82} = 1;
                

    Запустите сценарий перемещения (как пользователь 'otrs', а НЕ root):

    shell> scripts/DBUpdate-to-3.3.pl
                

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

  10. Refresh the configuration and delete caches. Please run (as user 'otrs', NOT as 'root'):

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

  11. Перезапустите сервисы.

    в т.ч. (зависящие от использующихся услуг):

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

    Теперь вы можете войти в систему.

  12. Проверьте установленные пакеты

    Проверьте в менеджере пакетов все ли пакеты по прежнему помечены как правильно установлены или какие либо из них требуют переустановки или же обновления.

    The following packages are automatically uninstalled after the upgrade process (if they where installed before):

    • OTRSPostMasterFilterExtensions

    • OTRSFreeTextFromCustomerUser

    • OTRSExternalTicketNumberRecognition

    • OTRSDashboardQueueOverview

    • OTRSImportantArticles

    • OTRSImportantArticlesITSM

    • OTRSDashboardTicketCalendar

    • OTRSMultiServiceSelect

    • OTRSMultiQueueSelect

    • OTRSDynamicFieldMultiLevelSelection

    • OTRSEventBasedTicketActions

    • OTRSTicketAclEditor

    • OTRSCustomerProcessSelection

    • OTRSACLExtensions

    • OTRSGenericStandardTemplates

    • OTRSExtendedDynamicDateFieldSearch

    • OTRSDashboardTicketOverviewFilters

  13. Check config settings of OTRSFreeTextFromCustomerUser

    Note: This only applies if you used the package OTRSFreeTextFromCustomerUser previously.

    If you used this module previously, you need to reconfigure it. The module is automatically uninstalled by the upgrading script as it is now a part of the OTRS framework.

    If you want to keep using it, please enable the setting "Ticket::EventModulePost###930-DynamicFieldFromCustomerUser" to activate this feature and configure the mapping in the setting "DynamicFieldFromCustomerUser::Mapping".

  14. Import your ACLs to the new ACL editor (optional)

    In OTRS 3.3, there is a graphical editor for ACLs in the administration interface. You will need to import your existing ACLs (e.g. in Config.pm or additional files) to the editor by using bin/otrs.ImportACLsFromConfig.pl in order to make them available in the editor. Please make sure to delete any ACLs from Config.pm (or other files) after successfully finishing the import procedure. Also you will need to use the deploy button in the ACL administration frontend in order to re-deploy the imported ACLs to your system.

  15. Update your web server configuration

    Note: this applies only if you use the Apache web server, and do not use the configuration file directly from the OTRS installation directory (e. g. with a symlink from the Apache configuration directory).

    Please update the the Apache configuration file for OTRS as there have been several changes (see scripts/apache2-httpd.include.conf).

  16. Update and activate cronjobs

    There are several OTRS default cronjobs in $OTRS_HOME/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 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 system user!

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

  17. Activate OTRS Scheduler Service

    This only applies if you did not previously configure the OTRS scheduler service.

    OTRS comes with a scheduler service that is used to perform asynchronous tasks.

    The OTRS RPMs will set up the Scheduler Service automatically. If you install/update from source, you can install the service by copying the scripts/otrs-scheduler-linux file to /etc/init.d and giving it the appropriate permissions. This will make sure the scheduler service starts when the system starts up.

  18. Молодцы!