Migrating Zabbix from one Linux server to another

Migrating Zabbix from one Linux server to another

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.

More information about Zabbix Server?

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.

The process of Migrating from Zabbix centos to debian

To start, Log into your CentOS server where zabbix you want to migrate is running.
Then follow the steps provided below;

1. Stop Zabbix Services

You need to stop Zabbix services by running the command:

systemctl stop httpd systemctl stop zabbix-server systemctl stop zabbix-agent

2.  Backup Zabbix database

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.

3. Transfer database dump file to the destination server

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.

4. Install packages required before Zabbix is installed in the destination 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

5. Start and enable services installed packages

To do this, run the following command;

systemctl start apache2 systemctl enable apache systemctl start mariadb

6. Create root password mysql

To do this, run the command;


7. Create database for Zabbix

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';

8. Restore database (From zabbix backed up database file)

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.

9. Finish Zabbix installation

Now go to the website of zabbix and find the latest .deb package and follow the instructions;


10. Modify zabbix conf file

To modify zabbix configuration file, run the command;

nano /etc/zabbix/zabbix_server.conf

And the enter the username, database name, and password. Then save and exit.

11. Change System timezone

To change timezone, execute;

sudo nano /etc/zabbix/apache.conf

In this file , you can change the timezone.

12. Start Zabbix Services

To do this, execute;

systemctl restart apache2 systemctl start zabbix-server systemctl start zabbix-agent

13. Open Web Interface to test Zabbix Installation

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.

[Need to perform Zabbix Server related tasks? We are available to help you today.]

Who We Are ?

Most prominent, efficient, and well-performing IT companies and software solutions.

Related Posts