Migrate Zabbix 6.4 to Zabbix 7.0 LTS

Zabbix 6.4 to 7.0 LTS migration (MySQL and PostgreSQL)

Comprehensive step-by-step guide to migrate Zabbix 6.4 to Zabbix 7.0 LTS for MySQL and PostgreSQL. Includes pre-checks, database commands, schema upgrades, and rollback instructions.

Table of Contents

🔈Introduction

Upgrading your Zabbix monitoring platform from version 6.4 to version 7.0 LTS is a strategic move that ensures long-term support, improved scalability, and enhanced performance. Active support for Zabbix 6.4 ended on June 30, 2024. The 7.0 LTS release (Long-Term Support) is designed for stability and enterprise use, providing five years of maintenance and security updates.

This guide walks you step-by-step through a production-grade migration process for both MySQL/MariaDB and PostgreSQL backends. It is concise and includes command-line examples, upgrade workflows, and validation steps.


✅ Why Upgrade to Zabbix 7.0 LTS

BenefitDescription
Zabbix 7.0 LTS SupportSupported until June 2029 — ideal for stable environments.
Improved Polling EngineAsynchronous pollers improve scalability and performance.
Enhanced UI and APIsFaster interface, updated widgets, extended REST API.
Security and ComplianceUpdated encryption libraries and password handling.
Native PHP 8+ CompatibilityFrontend now requires PHP 8.0 or newer.

✅ Pre-Migration Preparation

🟢 Environment Audit

Before starting the migration, collect key information about your Zabbix environment:

ComponentCommand/LocationNotes
Zabbix Versionzabbix_server -VVerify you’re running 6.4.x
OScat /etc/os-releaseSupported: RHEL 9, Ubuntu 22.04+, Debian 12, etc.
Databasemysql -V or psql --versionMySQL 8+ or PostgreSQL 13+ recommended
PHP Versionphp -vMust be ≥ 8.0
Free Disk Spacedf -hEnsure enough room for schema migration

🟢 Backup Strategy

A complete backup is mandatory before upgrading.

🔹Configuration Files

Backup key configs:

				
					sudo cp /etc/zabbix/zabbix_server.conf /etc/zabbix/zabbix_server.conf.bak
				
			
				
					sudo cp -r /etc/zabbix/web/ /etc/zabbix/web_backup/
				
			
				
					sudo cp -r /usr/lib/zabbix/externalscripts /usr/lib/zabbix/externalscripts_backup
				
			

🔹Database Backups

MySQL/MariaDB:
				
					mysqldump -u root -p --single-transaction --quick --routines zabbix > /backup/zabbix_mysql_6.4.sql
				
			
PostgreSQL:
				
					sudo -u postgres pg_dump -Fc zabbix > /backup/zabbix_pg_6.4.dump
				
			

The -Fc flag creates a compressed, restorable dump that works with pg_restore.

Snapshot (Recommended)

If your Zabbix server runs in a VM or container, take a full system snapshot.


🔄 System Requirement Comparison

ComponentZabbix 6.4Zabbix 7.0 LTSRequired Action
PHP7.4–8.28.0–8.3Upgrade if below 8.0
MySQL≥ 5.7≥ 8.0.30Upgrade MySQL if older
PostgreSQL≥ 12≥ 13Upgrade PostgreSQL if needed
OSRHEL 8/Ubuntu 20.04RHEL 9/Ubuntu 22.04+Update if unsupported

✅ Migration Steps

🟢 Step 1: Schedule Downtime

Notify users and schedule a maintenance window. The upgrade will briefly stop all monitoring and alerting.

🟢 Step 2: Stop Zabbix Services

				
					sudo systemctl stop zabbix-server zabbix-agent zabbix-proxy
				
			
				
					sudo systemctl stop nginx php-fpm   # Or Apache (httpd), if applicable
				
			

🟢 Step 3: Update Repositories

RHEL 9 / CentOS Stream 9:

				
					rpm -Uvh https://repo.zabbix.com/zabbix/7.0/rhel/9/x86_64/zabbix-release-7.0-5.el9.noarch.rpm
dnf clean all
dnf upgrade zabbix-server-mysql zabbix-server-pgsql zabbix-frontend-php zabbix-agent
				
			

Ubuntu 22.04:

				
					wget https://repo.zabbix.com/zabbix/7.0/ubuntu/pool/main/z/zabbix-release/zabbix-release_7.0-5+ubuntu22.04_all.deb
sudo dpkg -i zabbix-release_7.0-5+ubuntu22.04_all.deb
sudo apt update
sudo apt install --only-upgrade zabbix-server-mysql zabbix-server-pgsql zabbix-frontend-php zabbix-agent
				
			
⚠️ NOTE: Choose either the MySQL or PostgreSQL server package, matching your backend.

🟢 Step 4: Verify Configuration

Edit /etc/zabbix/zabbix_server.conf to ensure correct database parameters. Examples:

MySQL Example:

				
					DBHost=localhost
DBName=zabbix
DBUser=zabbix
DBPassword=strongpassword
				
			

PostgreSQL Example:

				
					DBHost=localhost
DBName=zabbix
DBUser=zabbix
DBPassword=strongpassword
				
			

🟢 Step 5: Start and Run Schema Upgrade

Start the Zabbix server. It will automatically detect and upgrade the schema.

				
					sudo systemctl start zabbix-server
				
			
				
					tail -f /var/log/zabbix/zabbix_server.log
				
			

Look for entries like:

				
					upgrading database from version 06040000 to 07000000
database upgrade successfully completed
				
			

🟢 Step 6: Start Remaining Services

				
					sudo systemctl start php-fpm nginx
				
			
				
					sudo systemctl start zabbix-agent
				
			
				
					sudo systemctl start zabbix-proxy
				
			

Then, log in to the frontend and verify the version at the bottom of the home page:

Zabbix 6.4 to 7.0 LTS migration (MySQL and PostgreSQL)

Photo by admingeek from Infotechys


✅ Database-Specific Considerations

🟢 MySQL / MariaDB Notes

  • Ensure innodb_file_per_table is enabled.
  • Consider using utf8mb4 for full Unicode support:
				
					ALTER DATABASE zabbix CHARACTER SET utf8mb4 COLLATE utf8mb4_bin;
				
			
  • If using TimescaleDB for trend compression, migrate via official scripts after upgrade.

🟢 PostgreSQL Notes

  • Zabbix 7.0 LTS fully supports TimescaleDB 2.12+ for trends.
  • Check for bytea_output setting (must be 'hex').
  • PostgreSQL upgrade (if needed) can be performed with pg_upgrade or pg_dumpall.
  • For large installations, analyze and vacuum after upgrade:
				
					sudo -u postgres vacuumdb --all --analyze-in-stages
				
			

✅ Post-Upgrade Tasks

🟢 Validate Components

TaskVerification
FrontendLogin and check dashboard loads
Proxieszabbix_proxy.log shows “active data sender started”
AgentsData items updating within 5 min
AlertingSend test email or webhook

🟢 Update Templates

Zabbix 7.0 introduces new official templates. Replace or update legacy 6.4 templates.
Import templates via UI (Data Collection → Templates → Import) or API:

				
					zabbix_import --server=https://zabbix.example.com --user=Admin --password=zabbix --template template_7.0_host.xml
				
			

🟢 Performance Tuning

After confirming system health, tune key parameters in /etc/zabbix/zabbix_server.conf:

ParameterDefaultRecommended for Large Setups
StartPollers520–50
StartTrappers520
StartHistoryPollers510–20
CacheSize8M64M+
HistoryCacheSize16M128M+

🟢 Cleanup and Optimize

Remove outdated packages:

				
					sudo apt autoremove               # Ubuntu/Debian
				
			
				
					sudo dnf autoremove               # RHEL 8+ or higher
				
			

Check for deprecated custom scripts and verify all modules compile correctly with Zabbix 7.0.

🟢 Backup New Version

Once the migration is successful, create a fresh backup of the new environment.


✅ Rollback Procedure

If the upgrade fails or regression occurs:

  • ✅ Stop Zabbix 7.0 services:
				
					sudo systemctl stop zabbix-server zabbix-agent zabbix-proxy
				
			
  • ✅ Restore the database:

MySQL:

				
					mysql -u root -p zabbix < /backup/zabbix_mysql_6.4.sql
				
			

PostgreSQL:

				
					sudo -u postgres pg_restore -d zabbix /backup/zabbix_pg_6.4.dump
				
			
  • ✅ Reinstall Zabbix 6.4 packages from repository.
  • ✅ Restart all services and confirm the frontend works.

📋 Migration Checklist

TaskStatus
Backup database and configs
Verify PHP 8+ and OS support
Stop Zabbix services
Upgrade repositories and packages
Verify DB connection config
Run schema upgrade
Validate frontend and proxies
Update templates
Tune performance
Create post-upgrade backup

🔧 Troubleshooting

IssueCauseFix
Server fails to startPHP or DB mismatchVerify PHP 8+ and DB credentials
Schema upgrade stalledDB locks or large tablesStop and resume, ensure DB storage is sufficient
Frontend shows blank pagePHP modules missingInstall php-xml, php-bcmath, php-gd
High CPU after upgradeCache too smallIncrease CacheSize and HistoryCacheSize

🏁 Conclusion

Migrating from Zabbix 6.4 to Zabbix 7.0 LTS delivers a faster, more stable, and future-ready monitoring platform. With built-in schema upgrades and LTS support, the transition is straightforward for both MySQL and PostgreSQL environments—provided you prepare carefully and follow best practices.

After upgrading:

  • Re-evaluate performance parameters
  • Replace old templates with official 7.0 versions
  • Continue monitoring logs for 48 hours

When executed properly, this migration ensures continuity and readiness for years of reliable operations.

Did you find this article helpful? Your feedback is invaluable to us! Feel free to share this post with those who may benefit, and let us know your thoughts in the comments section below.


📕 Related Posts

Leave a Reply

Your email address will not be published. Required fields are marked *