Outdated documentation

You are looking at the documentation for an older release. For the latest information, please see current release documentation.

更新

There are two different scenarios to obtain a newer OTRS version:

  • Patch level update: you are using OTRS 7 and you want to have the latest OTRS 7 version.
  • Major upgrade: you are using an OTRS 6 and you want to have the latest OTRS 7 version.
从 OTRS 7 的早期版本更新

You can update directly from any previous patch level release to the latest available patch level release.

注解

强烈建议在一台独立的测试主机上先进行升级测试。

Upgrading from OTRS 6

OTRS can be upgraded from any OTRS 6 patch level release to the latest available OTRS 7 patch level release.

注解

OTRS is upgraded by the Customer Solutions Team. Please contact us via support@otrs.com or in the OTRS Portal.

Upgrading from OTRS 5 or earlier

OTRS cannot be upgraded from OTRS 5 or earlier directly to OTRS 7. Upgrades to all available major versions have to be made sequentially instead. For example, if you come from OTRS 4, OTRS has to be upgraded to OTRS 5 first, then to OTRS 6 and finally to OTRS 7.

注解

OTRS is upgraded by the Customer Solutions Team. Please contact us via support@otrs.com or in the OTRS Portal.

第1步:停止所有相关服务和 OTRS 守护进程

请确保没有任何运行中的服务或 CRON 计划任务还在试图访问 OTRS,这取决于你的服务配置和 OTRS 版本。

The following systemctl commands are only examples and may differ on the target system if it uses different mailer or web server.

root> systemctl stop postfix
root> systemctl stop apache2

If you do an upgrade from OTRS 6, you need to stop the old OTRS cron jobs and daemon (in this order):

otrs> /opt/otrs/bin/Cron.sh stop
otrs> /opt/otrs/bin/otrs.Daemon.pl stop

如果在 OTRS 7 中执行补丁级别更新(使用新的 systemd 文件),请通过 systemd 停止 OTRS 服务:

root> systemctl stop otrs-daemon
root> systemctl stop otrs-webserver

第2步:备份文件和数据库

创建下列文件和目录的备份:

  • Kernel/Config.pm
  • custom files in Kernel/Config/Files/
  • Kernel/Config/Files/User/*
  • Kernel/WebApp.conf (仅在 OTRS 7 的补丁级别更新的情况下,并且仅在文件被修改时)
  • var/*
  • files which are not part of the official release package but added manually to the system (custom language files, logos, CSS style sheets, XML configuration, etc.)
  • 当然还有数据库

注解

It is recommended to have an up-to-date list of files which are added manually or changed in the system.

警告

如果没有完整的系统备份,请不要继续。 使用 备份 脚本。

第3步:安装新版本

注解

OTRS 7 不再提供 RPM 包,基于 RPM 的安装需要先卸载原有的 RPM 包(这不会删除数据库),然后使用源文件安装。

You can obtain either otrs-patchlevel-update-x.y.z.tar.gz or otrs-patchlevel-update-x.y.z.tar.bz2. Unpack the source archive (for example, using tar) into the directory /opt, and create a symbolic link /opt/otrs that points to /opt/otrs-x.y.z.

Do not forget to replace the version numbers!

注解

Package bzip2 is not installed in some systems by default. Make sure, that bzip2 is installed before unpacking otrs-patchlevel-update-x.y.z.tar.bz2.

Unpack command for otrs-patchlevel-update-x.y.z.tar.gz:

root> tar -xzf otrs-patchlevel-update-x.y.z.tar.gz -C /opt

Unpack command for otrs-patchlevel-update-x.y.z.tar.bz2:

root> tar -xjf otrs-patchlevel-update-x.y.z.tar.bz2 -C /opt

It is recommended to create a symbolic link named /opt/otrs that always points to the latest OTRS version. Using symbolic link makes it easier to manage the OTRS updates, because you can leave the directory of the previous version untouched, only the symbolic link needs to be changed.

执行此命令以创建符号链接:

root> ln -fns /opt/otrs-x.y.z /opt/otrs

If you need to revert the update, you can change the target of the symbolic link back if you did not run the migration script already in step 4. If the migration script was executed, the database needs to be restored from the backup in case of a rollback.

恢复原配置文件

  • Kernel/Config.pm
  • custom files in Kernel/Config/Files/
  • Kernel/Config/Files/User/*
  • Kernel/WebApp.conf (仅在 OTRS 7 的补丁级别更新的情况下,并且仅在文件被修改时)
  • files which are not part of the official release package but added manually to the system (custom language files, logos, CSS style sheets, XML configuration, etc.)

Check for hidden files with the ls -a command like .fetchmailrc, .mailfilter, .procmailrc in the previous OTRS directory. If these files exist without .dist extension, copy them to the OTRS folder using the cp -p command to preserve the permissions.

恢复信件数据

如果您将 OTRS 配置为在文件系统中存储信件数据,则必须将 article 目录恢复到 /opt/otrs/var/ 或系统配置中指定的目录。

恢复已安装的默认统计

如果您有其它具有默认统计信息的软件包,则必须将带有后缀 *.installed 的统计信息 XML 文件恢复到 /opt/otrs/var/stats

root> cd OTRS-BACKUP/var/stats
root> cp *.installed /opt/otrs/var/stats

设置文件权限

请执行以下命令为 OTRS 设置文件和目录权限。它将尝试检测你的安装所需的正确的用户和组设置。

root> /opt/otrs/bin/otrs.SetPermissions.pl

安装必需的程序和 Perl 模块

Use the following script to get an overview of all installed and required CPAN modules and other external dependencies.

root> perl /opt/otrs/bin/otrs.CheckEnvironment.pl
Checking for Perl Modules:
  o Archive::Tar.....................ok (v1.90)
  o Archive::Zip.....................ok (v1.37)
  o Crypt::Eksblowfish::Bcrypt.......ok (v0.009)
...

注解

Please note that OTRS requires a working Perl installation with all core modules such as the module version. These modules are not explicitly checked by the script. You may need to install a perl-core package on some systems like RHEL that do not install the Perl core packages by default.

To install the required and optional packages, you can use either CPAN or the package manager of your Linux distribution.

Execute this command to get an install command to install the missing dependencies:

root> /opt/otrs/bin/otrs.CheckEnvironment.pl --list

OTRS requires a supported stable version of Node.js to be installed. Please refer to the Node.js installation instructions.

第4步:运行迁移脚本

The migration script will perform many checks on your system and give you advice on how to install missing Perl modules etc., if that is required. If all checks succeeded, the necessary migration steps will be performed.

注解

Please also run this script in case of patch level updates.

运行这个迁移脚本:

otrs> /opt/otrs/scripts/DBUpdate-to-7.pl

警告

如果此脚本无法正常工作,请不要继续升级过程。 否则可能会发生故障或丢失数据。

迁移脚本还会检查 ACL 和系统配置设置是否正确。 如果系统配置设置无效,脚本将为您提供通过从可能值列表中进行选择来修复它的机会。 如果脚本以非交互模式运行,它将尝试自动修复无效设置。 如果此操作失败,将要求您在迁移后手动更新设置。

如果存在过期的 ACL,系统将无法自动修复它们,并且需要由管理员进行更正。 有关详细信息,请参阅手动更改的最后一步。

第5步:更新已安装的软件包

注解

Packages for OTRS 6 are not compatible with OTRS 7 and have to be upgraded.

你可以使用下面的命令来更新所有已安装的软件包。 这适用于从在线存储库提供的所有软件包。 您稍后可以通过软件包管理器更新其他软件包(这需要 OTRS 守护进程在运行)。

otrs> /opt/otrs/bin/otrs.Console.pl Admin::Package::UpgradeAll
otrs> /opt/otrs/bin/otrs.Console.pl Admin::Package::ReinstallAll

第6步:启动服务

OTRS 7 comes with an own built-in web server that is used behind Apache as a reverse proxy (or any other reverse proxy server). For upgrade from OTRS 6, the Apache configuration must be updated with the new version in /opt/otrs/scripts/apache2-httpd.include.conf, if it was copied and not just linked.

还请注意,虽然不再需要 “mod_perl” 模块,但现在需要其它 Apache 模块:

  • mod_headers
  • mod_proxy
  • mod_proxy_http
  • mod_proxy_wstunnel

之后,可以启动服务。 这取决于您的服务配置,这是一个示例:

root> systemctl start postfix
root> systemctl start apache2

注解

OTRS 守护进程是正确操作 OTRS 所必需的,例如发送电子邮件。 请按照下一步中的说明激活它。

第7步:启动 OTRS 守护进程和 Web 服务器

OTRS 守护进程负责处理 OTRS 中的任何异步和重复任务。 内置的 OTRS Web 服务器进程处理从 Apache 移交的 Web 请求。

OTRS 附带了 systemd 示例配置文件,可用于确保在系统启动后自动启动 OTRS 守护进程和 Web 服务器。

root> systemctl start otrs-daemon
root> systemctl start otrs-webserver

现有你可以登录到系统了。

第8步:手动迁移任务和更改

警告

Read this step carefully and apply the actions only if they are relevant to your system.

由于旧的客户界面屏幕不再存在,因此管理员需要手动更正某些 ACL。 如果是这种情况,迁移脚本已通知您。

受影响的 ACL 是指在 Action(操作) 设置中引用不存在的客户界面屏幕的 ACL。 这个前端 Action(操作) 规则需要用相应的 Endpoint(端点) 规则替换。 下面包括一个可能的映射表。

操作 端点
CustomerTicketPrint 没有替换(功能缺失)
CustomerTicketZoom ExternalFrontend::TicketDetailView
CustomerTicketProcess ExternalFrontend::ProcessTicketCreateExternalFrontend::ProcessTicketNextStep
CustomerTicketMessage ExternalFrontend::TicketCreate

RPC is completely redesigned in OTRS 7 and the rpc.pl does not exist anymore. There is an operation within SOAP called Generic::RPC.

RPC web services can no longer be used without problems. You will need to take a look at your web services after upgrading to OTRS 7 and probably rebuild them in a different way.

You also have the option to book a consultant who can work with you to rebuild your web services.

Upgrade Elasticsearch

Upgrade your Elasticsearch installation if newer version is available. For more information read the Upgrade Elasticsearch chapter in the official documentation.

参见

Please refer to the 硬件和软件要求 chapter for the supported versions.

Additionally, OTRS requires plugins to be installed into Elasticsearch. When a newer Elasticsearch version is installed, the plugins have to be removed and installed again.

root> /usr/share/elasticsearch/bin/elasticsearch-plugin remove analysis-icu
root> /usr/share/elasticsearch/bin/elasticsearch-plugin remove ingest-attachment
root> /usr/share/elasticsearch/bin/elasticsearch-plugin install --batch ingest-attachment
root> /usr/share/elasticsearch/bin/elasticsearch-plugin install --batch analysis-icu

注解

Restart Elasticsearch afterwards, or indexes will not be built.

To verify the Elasticsearch installation, you can use the following command:

otrs> /opt/otrs/bin/otrs.Console.pl Maint::DocumentSearch::Check
Trying to connect to cluster...
  Connection successful.

Elasticsearch 7.x changed some configuration settings and behaviors. A full list of changes from Elasticsearch 6.x to 7.x can be reviewed in the Elasticsearch Reference.

One of those options is explicitly interesting for OTRS, which is the maximum amount of open scroll contexts, that had a value of 1000 until the latest version of Elasticsearch 6.x and was reduced to 500 in Elasticsearch 7.x.

In normal situations, this value should not be reached, but we recommend to set this value back to 1000 with the following option, that has to be added to the configuration file elasticsearch.yml:

search.max_open_scroll_context: 1000

Allow Program Safe to Run

External programs to be run by OTRS are blocked by default due to security reasons. You have to add the program to the allow list as described in the Administration Manual.