Operations 4 min read

Migrating a Zabbix Monitoring Server to a New Host Without Data Loss

This guide explains how to safely migrate a Zabbix monitoring server to a new machine by backing up the MySQL database with mysqldump, importing it on the new host, updating configuration files, restarting services, and ensuring time synchronization to maintain uninterrupted monitoring.

Practical DevOps Architecture
Practical DevOps Architecture
Practical DevOps Architecture
Migrating a Zabbix Monitoring Server to a New Host Without Data Loss

The organization has a Zabbix monitoring server that needs to be moved to another server while preserving all existing data and keeping the monitoring service operational.

Migration starts with backing up the original Zabbix server's MySQL database using mysqldump -u root -p --default-character-set=UTF8 --opt zabbix > zabbix.sql .

Enter password:******

Because the server has been running for a long time and contains a large amount of data, the dump may take around half an hour.

Copy the generated zabbix.sql file to the new Zabbix server's /mnt directory via SCP, then import it into MySQL; ensure the local Zabbix service is already running before the import.

Import command: mysql -u root -p zabbix < zabbix.sql

Enter password:******

Alternatively, the equivalent command is cat zabbix | mysql -u root -p zabbix .

Enter password:******

Directly copying the raw database files can be faster but often fails due to MySQL version differences, so using mysqldump is the safer approach.

Next, edit the server configuration file: vim /etc/zabbix/zabbix_server.conf

Set DBUser=root (replace with your MySQL user) and DBPassword=cnczabbix (plain‑text password; comment out if none).

Then edit the client configuration file: vim /etc/zabbix/zabbix_agentd.conf

Update Server=192.168.10.101 to the new server’s IP address (or use 127.0.0.1 for self‑monitoring).

After the changes, restart the Zabbix services:

/etc/zabbix/sbin/zabbix_server stop

/etc/zabbix/sbin/zabbix_server start

/etc/zabbix/sbin/zabbix_agentd stop

/etc/zabbix/sbin/zabbix_agentd start

Finally, log into the new Zabbix server (e.g., http://192.168.10.101/zabbix or http://localhost/zabbix ) to verify that everything works as before.

If monitoring data does not update, check that the system clocks on both servers are synchronized; time drift is a common cause of this issue.

MigrationMonitoringMySQLBackupZabbix
Practical DevOps Architecture
Written by

Practical DevOps Architecture

Hands‑on DevOps operations using Docker, K8s, Jenkins, and Ansible—empowering ops professionals to grow together through sharing, discussion, knowledge consolidation, and continuous improvement.

0 followers
Reader feedback

How this landed with the community

login Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.