AMI Upgrades

Please read the entire section before do nothing, and prepare a backup of all your data

As zabbix release new versions each time, with new features and improvements, it’s the best choice to get our Zabbix AMI upgrade each time. Sadly, the same new features and improvements include changes on database and internally that can be problematic to upgrade your Zabbix installation.

Our Zabbix AMI is the best way to avoid these problems, because we offer a way to upgrade between major versions, that are more fast, simple and secure that usual ones.

Upgrade summary

The upgrade process for our AMI is quite simple, and is summarized in the following steps:

  • Perform a dump of our current database.
  • Launch a new AMI with the latest stable version.
  • Upload the database dump to the new instance
  • Run our migration script

This way, we keep the current version and the new one at the same time, and we can do the necessary tests to ensure that everything works correctly, and then change the EIPs associated to that instance, or migrate the clients slowly.

in this tutorial we use the term “source” to refer to your current Zabbix server, and “target” to refer to the new server.

Upgrade process

Step 1: Backup of the source server

The first step is to make an image of our source server, to avoid any accidental data loss. You can see the AWS manual to create an AMI.

Step 2: Dump of our database and Zabbix version

The second step is to make a database dump of the source Zabbix server. To do this, we SSH into our instance, and log in as root with the command:

sudo /bin/su -

then, we will dump the database to a file with the command:

mysqldump zabbix > zabbix_origin_database.sql

Finally, we will download the created file to our machine, and then upload it to the new server.

We must also note the current version of Zabbix we are using. We can see the version in the Zabbix web interface, and it should be a number similar to 4.0, 4.2, 4.4 or 5.4.

Step 3: Launch a new Zabbix instance

The next step is to create a new Zabbix instance, using the latest stable version of the AMI that you can find on our AWS Marketplace profile. At a minimum, you should use version 6.1 of our Zabbix AMI.

This new instance is going to be the target server where we will move our data, and it already comes with the latest version installed and updated.

Once the instance is started, we must copy the database dump from the source server to this new server.

Step 4: Upgrade the database

To insert our current database, upgrade it to the new version, and add the necessary configurations, we must use the script located in /opt/tools/bin/zabbix-ami-upgrade.sh, which must be run as ubuntu user, and to which we must indicate the original version of Zabbix, and the file with the data dump.

For example, if we are migrating from Zabbix 4.0 and we have dumped the current database in zabbix_origin_database.sql, we should execute:

/opt/tools/bin/zabbix-ami-upgrade.sh 4.0 zabbix_origin_database.sql

The process will inform us of the steps it is taking, and once it is finished we can continue working with our new Zabbix server.

Step 5: Access the web interface

Once the migration is finished, we will be able to access the web interface and see the general status of our server. It is important to note that we must use the same users and passwords that we had on the previous server.

Step 6: Migrate special configurations and configure clients

Once our database is operational, we must take into account other types of configurations that we have been able to install on the server, such as:

  • monitoring scripts
  • additional system packages
  • SSL certificates that we have installed

We will also have to move the EIP that we have configured for that instance, so that the clients do not need to be modified.

If we are not using EIP, it is a good time to start doing so, as we will need to change the IP of the new server on the clients.