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
Stop the services:
# systemctl stop wazuh-api # systemctl stop wazuh-manager
Add the new repository for Wazuh 3.x.
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
For Debian/Ubuntu:
# echo "deb https://packages.wazuh.com/3.x/apt/ stable main" | tee -a /etc/apt/sources.list.d/wazuh.list
Upgrade the manager.
Upgrade the Wazuh manager on CentOS/RHEL/Fedora:
# yum install wazuh-manager
Upgrade the Wazuh manager on Debian/Ubuntu:
# apt-get update # apt-get install wazuh-manager
Upgrade the API.
Upgrade the Wazuh API on CentOS/RHEL/Fedora:
# yum install wazuh-api
Upgrade the Wazuh API on Debian/Ubuntu:
# apt-get install wazuh-api
Upgrade Wazuh agent
Stop the service:
# systemctl stop wazuh-agent
Add the new repository for Wazuh 3.x.
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
For Debian/Ubuntu:
# echo "deb https://packages.wazuh.com/3.x/apt/ stable main" | tee -a /etc/apt/sources.list.d/wazuh.list
Upgrade the agent.
Upgrade the Wazuh agent on CentOS/RHEL/Fedora:
# yum install wazuh-agent
Upgrade the Wazuh agent on Debian/Ubuntu:
# apt-get update # apt-get install wazuh-agent
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.
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.10.2-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:
For CentOS/RHEL/Fedora:
# sed -i "s/^enabled=1/enabled=0/" /etc/yum.repos.d/wazuh.repo
For Debian/Ubuntu:
# sed -i "s/^deb/#deb/" /etc/apt/sources.list.d/wazuh.list # apt-get updateAlternately, you can set the package state to
hold
, which will stop updates (although you can still upgrade it manually usingapt-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