This is the documentation for Wazuh 3.9. Check out the docs for the latest version of Wazuh!

Upgrade from different major version

The following steps show how to upgrade from Wazuh 2.x to Wazuh 3.x (which implies upgrading from Elastic Stack 5.x to 6.x).

Upgrade Wazuh manager

  1. Stop the services:
# systemctl stop wazuh-api
# systemctl stop wazuh-manager
  1. Add the new repository for Wazuh 3.x.
  1. For CentOS/RHEL/Fedora:
# cat > /etc/yum.repos.d/wazuh.repo <<\EOF
[wazuh_repo]
gpgcheck=1
gpgkey=https://packages.wazuh.com/key/GPG-KEY-WAZUH
enabled=1
name=Wazuh repository
baseurl=https://packages.wazuh.com/3.x/yum/
protect=1
EOF
  1. For Debian/Ubuntu:
# echo "deb https://packages.wazuh.com/3.x/apt/ stable main" | tee -a /etc/apt/sources.list.d/wazuh.list
  1. Upgrade the manager.
  1. Upgrade the Wazuh manager on CentOS/RHEL/Fedora:
# yum install wazuh-manager
  1. Upgrade the Wazuh manager on Debian/Ubuntu:
# apt-get update
# apt-get install wazuh-manager
  1. Upgrade the API.
  1. Upgrade the Wazuh API on CentOS/RHEL/Fedora:
# yum install wazuh-api
  1. Upgrade the Wazuh API on Debian/Ubuntu:
# apt-get install wazuh-api

Upgrade Wazuh agent

  1. Stop the service:
# systemctl stop wazuh-agent
  1. Add the new repository for Wazuh 3.x.
  1. For CentOS/RHEL/Fedora:
# cat > /etc/yum.repos.d/wazuh.repo <<\EOF
[wazuh_repo]
gpgcheck=1
gpgkey=https://packages.wazuh.com/key/GPG-KEY-WAZUH
enabled=1
name=Wazuh repository
baseurl=https://packages.wazuh.com/3.x/yum/
protect=1
EOF
  1. For Debian/Ubuntu:
# echo "deb https://packages.wazuh.com/3.x/apt/ stable main" | tee -a /etc/apt/sources.list.d/wazuh.list
  1. Upgrade the agent.
  1. Upgrade the Wazuh agent on CentOS/RHEL/Fedora:
# yum install wazuh-agent
  1. Upgrade the Wazuh agent on Debian/Ubuntu:
# apt-get update
# apt-get install wazuh-agent
  1. For Windows:

The agent upgrading process for Windows systems requires to download the latest available installer from the packages list. There are two ways of using it (both of them require administrator rights):

  • Using the GUI installer:

Open the installer and follow the instructions to upgrade the agent.

../../_images/windows.png
  • Using the command line:

To upgrade the Windows agent from the command line, run the installer using Windows PowerShell or the command prompt (the /q argument is used for unattended installations):

# wazuh-agent-3.9.5-1.msi /q

Note

To learn more about the unattended installation process, you can check the Windows installation guide.

Disable the Wazuh repository

We recommend that the Wazuh repository be disabled in order to prevent accidental upgrades. To disable the repository, follow these steps:

  1. For CentOS/RHEL/Fedora:
# sed -i "s/^enabled=1/enabled=0/" /etc/yum.repos.d/wazuh.repo
  1. For Debian/Ubuntu:
# sed -i "s/^deb/#deb/" /etc/apt/sources.list.d/wazuh.list
# apt-get update

Alternately, you can set the package state to hold, which will stop updates (although you can still upgrade it manually using apt-get install).

# echo "wazuh-manager hold" | sudo dpkg --set-selections
# echo "wazuh-api hold" | sudo dpkg --set-selections
# echo "wazuh-agent hold" | sudo dpkg --set-selections