Zabbix is an open-source monitoring software tool for diverse IT components, including networks, servers, virtual machines and cloud services.
Here at Outsource Path, as part of our Server Management Services, we regularly help our Customers to fix Zabbix related errors.
In this context, we shall look into the steps to migrate Zabbix from a Centos Server to Debian.
Zabbix provides monitoring metrics, among others network utilization, CPU load and disk space consumption. It can be deployed for agent-based and agentless monitoring. Agents are installed on IT components to check performance and collect data.
Basically, Zabbix works in optimizing Network discovery periodically by scanning an IT environment and records a device's type, IP address, status, uptime and downtime.
Similarly, Zabbix agent is deployed on a monitoring target to actively monitor local resources and applications (hard drives, memory, processor statistics etc). The agent gathers operational information locally and reports data to Zabbix server for further processing.
To start, Log into your CentOS server where zabbix you want to migrate is running.
Then follow the steps provided below;
You need to stop Zabbix services by running the command:
systemctl stop httpd systemctl stop zabbix-server systemctl stop zabbix-agent
Here, it is important to take a backup of the current zabbix database. To do so, execute;
sudo mysqldump -u root -p zabbix > /home/outsourcepath/zabbix.sql
In this command, "/home/outsourcepath/zabbix.sql" is that database file path.
When the backup is completed, then you have to transfer the file over to the new machine by using the rsync command or you can also download it manually and upload it to the new server.
Here, you can run the following commands to install the required packages for the zabbix installation;
apt install apache2 php php-mysql php-mysqlnd php-ldap php-bcmath php-mbstring php-gd php-pdo php-xml libapache2-mod-php
apt install mariadb-server mariadb-client
To do this, run the following command;
systemctl start apache2 systemctl enable apache systemctl start mariadb
To do this, run the command;
Here you will create a new database to store our sql data by running the query;
create database zabbix character set utf8 collate utf8_bin;
grant all privileges on zabbix.* to zabbix@localhost identified by 'yourpasswordhere';
To do this on the destination server, run the command;
mysql -u root -p zabbix < /home/outsourcepath/zabbix.sql
once completed the backup restore will be executed to proceed with zabbix installation.
Now go to the website of zabbix and find the latest .deb package and follow the instructions;
To modify zabbix configuration file, run the command;
And the enter the username, database name, and password. Then save and exit.
To change timezone, execute;
sudo nano /etc/zabbix/apache.conf
In this file , you can change the timezone.
To do this, execute;
systemctl restart apache2 systemctl start zabbix-server systemctl start zabbix-agent
Now open the web interface and fill out once again the database user details , after this you will be able to login with your stored credentials.
Now the process of migrating zabbix server is successful from CentOS to your new debian machine.
This article will help you to migrate Zabbix from one Linux server to another (Centos to Debian).