[comment]: # translation:outdated

[comment]: # ({c3117020-83c2fbfb})
# 1 Red Hat 企业版 Linux

[comment]: # ({/c3117020-83c2fbfb})

[comment]: # ({new-f5a2912b})
#### Overview

This section provides the steps required for a successful
[upgrade](/manual/installation/upgrade) from Zabbix **6.0**.x to Zabbix
**6.2**.x using official Zabbix packages for Red Hat Enterprise
Linux.

::: notewarning
Before the upgrade make sure to read the relevant
[**upgrade notes**](/manual/installation/upgrade)!
:::

You may also want to check the
[requirements](/manual/installation/requirements) for 6.2.

::: notetip
It may be handy to run two parallel SSH sessions during
the upgrade, executing the upgrade steps in one and monitoring the
server/proxy logs in another. For example, run
`tail -f zabbix_server.log` or `tail -f zabbix_proxy.log` in the second
SSH session showing you the latest log file entries and possible errors
in real time. This can be critical for production
instances.
:::

[comment]: # ({/new-f5a2912b})

[comment]: # ({93ff8b03-93ff8b03})
#### 升级过程

[comment]: # ({/93ff8b03-93ff8b03})

[comment]: # ({7a025d81-165cddb5})
##### 1 停止 Zabbix 进程

停止 Zabbix 服务器以确保没有新数据插入到数据库。

  · # systemctl stop zabbix-server

如果升级代理，也停止代理。

  ·#systemctl stop zabbix-proxy

::: noteimportant
不再可能启动升级后的服务器并让旧的和未升级的代理向较新的服务器报告数据。 Zabbix 从未推荐或支持的这种方法现在已被正式禁用，因为服务器将忽略来自未升级代理的数据。
::::

[comment]: # ({/7a025d81-165cddb5})

[comment]: # ({ab13a6a4-ab13a6a4})
##### 2 备份已有的Zabbix数据库

这是非常重要的一步。 确保您有数据库的备份。 如果升级过程失败（磁盘空间不足、电源关闭、任何意外问题），这将有所帮助。

[comment]: # ({/ab13a6a4-ab13a6a4})

[comment]: # ({73c0e0be-bddc3d2b})
##### 3 备份配置文件、PHP文件和Zabbix二进制文件

制作 Zabbix 二进制文件、配置文件和 PHP 文件目录的备份副本。

配置文件：

  · # mkdir /opt/zabbix-backup/
  · # cp /etc/zabbix/zabbix_server.conf /opt/zabbix-backup/
  · # cp /etc/httpd/conf.d/zabbix.conf · /opt/zabbix-backup/

PHP 文件和 Zabbix 二进制文件：

  · # cp -R /usr/share/zabbix/ /opt/zabbix-backup/
  · # cp -R /usr/share/zabbix-* /opt/zabbix-backup/

[comment]: # ({/73c0e0be-bddc3d2b})

[comment]: # ({new-f9da6e1f})
##### 4 Update repository configuration package

To proceed with the upgrade your current repository package has to be
updated.

    # rpm -Uvh https://repo.zabbix.com/zabbix/6.2/rhel/8/x86_64/zabbix-release-6.2-1.el8.noarch.rpm

[comment]: # ({/new-f9da6e1f})

[comment]: # ({2db81078-9524156f})
##### 5 升级Zabbix组件

要升级 Zabbix 组件，您可以运行如下命令：

  · # yum upgrade zabbix-server-mysql zabbix-web-mysql zabbix-agent

如果使用 PostgreSQL，请在命令中将 `mysql` 替换为 `pgsql`。 如果升级代理，请在命令中将 `server` 替换为 `proxy`。 如果升级agent 2，请在命令中将 `zabbix-agent` 替换为 `zabbix-agent2`。

要使用 Apache **on RHEL 8** 正确升级 Web 前端，还要运行：

  · # yum install zabbix-apache-conf

[comment]: # ({/2db81078-9524156f})

[comment]: # ({23b5c167-f25076e1})
##### 6 查看组件配置参数

有关 [强制更改](/manual/installation/upgrade_notes_600#configuration_parameters) 的详细信息，请参阅升级说明。

[comment]: # ({/23b5c167-f25076e1})

[comment]: # ({3190fa72-3190fa72})
##### 7 启动Zabbix进程

启动更新后的 Zabbix 组件。

  · # systemctl start zabbix-server
  · # systemctl start zabbix-proxy
  · # systemctl start zabbix-agent
  · # systemctl start zabbix-agent2

[comment]: # ({/3190fa72-3190fa72})

[comment]: # ({49e4f43e-49e4f43e})
##### 8 清除网络浏览器 cookie 和缓存

升级后，您可能需要清除网络浏览器 cookie 和网络浏览器缓存，以便 Zabbix web界面正常工作。

[comment]: # ({/49e4f43e-49e4f43e})

[comment]: # ({new-ad85b70b})
#### Upgrade between minor versions

It is possible to upgrade between minor versions of 6.2.x (for example,
from 6.2.1 to 6.2.3). Upgrading between minor versions is easy.

To execute Zabbix minor version upgrade it is required to run:

    $ sudo yum upgrade 'zabbix-*'

To execute Zabbix server minor version upgrade run:

    $ sudo yum upgrade 'zabbix-server-*'

To execute Zabbix agent minor version upgrade run:

    $ sudo yum upgrade 'zabbix-agent-*'

or, for Zabbix agent 2:

    $ sudo yum upgrade 'zabbix-agent2-*'

Note that you may also use 'update' instead of 'upgrade' in these
commands. While 'upgrade' will delete obsolete packages, 'update' will
preserve them.

[comment]: # ({/new-ad85b70b})
