Why updating Zabbix templates after an upgrade needs a plan
Upgrading the Zabbix server and frontend does not update the out-of-the-box templates on your installation. Those templates still reflect the older release until you bring them forward, and the method you use to do that decides whether your local changes survive. The safe approach is to plan the template update as its own step after the server upgrade, export or back up your current templates, and import the new versions in a way that keeps your customizations intact. Teams need this work whenever a new release changes item keys, triggers, discovery rules or macros that their hosts depend on, which is common enough that it should be treated as part of every upgrade rather than an afterthought.
The risk sits in how templates are copied back into the instance. A template in your installation may carry edits your team made to items, triggers, macros or discovery rules over several years. Importing the vendor version of a template replaces what is there, so those edits are lost unless you have recorded them first. The import_templates.sh script from the official documentation updates every template in one run through the configuration.import API method, needs curl and jq, and overwrites existing templates with no review step and no undo. That makes it a convenient tool for a fresh or disposable instance and a risky one for a production system with local changes. Confirm this behavior against the version you are running before you rely on it.
Before choosing an import method, list which templates you have modified, compare each against the release notes for the target version, and decide which changes to keep, move into a separate template, or retire. Then rehearse the full update on a staging copy of your database and frontend, check that dependent hosts still collect data and raise the expected problems, and keep a verified backup you can restore if the rehearsal fails. The Zabbix out-of-the-box templates documentation is the natural next read for the import options your version supports.
Which template import method fits your environment
This table compares the four ways to bring templates forward after an upgrade: single template import, bundle import, import_templates.sh, and cloning. Read each row against your change control and rollback needs, since the script is the only option that overwrites every template at once with no review step.
| Method | What it overwrites | What it preserves | Prerequisites and fit |
|---|---|---|---|
| Single template import (frontend) | Only the template file you import, matched by template name and UUID | Every other template, host links and your local items on other templates | Frontend access with import rights. Fits one or two templates you can review line by line before saving. |
| Bundle import (frontend or API) | Each template inside the bundle file, which can span many templates | Templates not included in the bundle | A file matching your server version. Fits planned updates where you review the bundle contents before importing. |
| import_templates.sh script | All existing out-of-the-box templates at once through the configuration.import API method | Only templates and items not in the script's scope. Local edits to standard templates are lost | Requires curl and jq and API access. Overwrites everything with no option to review or undo, so use it only on a tested staging copy with a database backup. |
| Clone as a custom template | Nothing on the original. The clone is a new template with its own name | Your local changes and the standard template stay intact for comparison | Frontend clone action with a naming convention. Fits sites that customize heavily, but the clone will not receive future vendor updates automatically. |
| Manual diff and merge | Only the items you choose to copy across after comparing exports | All local changes you do not copy, plus the rest of the template set | Needs an export of the old and new templates and a comparison tool. Fits teams with many local edits who need an auditable record of each change. |
What gets lost when templates are overwritten
The import_templates.sh script replaces every existing out-of-the-box template in one pass, so anything you changed inside those templates or built on top of them is at risk. The cards below cover the places where local work hides and how each one shows up after the import, so you can check them on a staging copy before production.
Local edits on built-in templates
Items, triggers, macros and thresholds you edited directly in a built-in template are overwritten by the bulk import. The problem often stays silent until a trigger stops firing or a macro falls back to its default value. Before the import, export each edited template and diff it against the new release, then record every macro value you override so you can reapply it.
Zabbix template docsCustomized discovery rules
Low-level discovery rules inside a built-in template carry your filters, LLD macros and prototype changes. A new release can replace them with its own version, so disks, interfaces or containers that matched your filter may start creating items or stop being discovered. Compare the item counts per host before and after the staging import to spot the change.
Changed inheritance on host prototypes
Host prototypes that link templates or inherit template settings can behave differently once the template structure changes. Hosts discovered from VMs or cloud resources may lose a linked template or pick up a new one without any manual action. Check the template list on a sample of discovered hosts after the import and confirm that the expected groups and tags are still applied.
Dashboards and value maps tied to items
Dashboards, graphs and value maps that reference template items depend on item keys and names. If an import renames or recreates an item, widgets can show no data and mappings can stop applying to the new values. Walk through each dashboard that uses template data on staging and confirm that every widget still resolves to a live item.
Custom templates linked to built-in ones
A custom template that links to an out-of-the-box template inherits whatever that template contains after the import. Your own triggers, items or macros in the custom template can then collide with new content, or a link can break if a template was renamed. Review every custom template's links and its parent template contents as part of the staging run.
How to update templates on a staging copy first
This sequence lets you move out-of-the-box templates to the upgraded version on a copy of production, see every change before it lands, and keep local customizations intact in separate templates.
Export production templates and record local changes
Before anything changes, the Zabbix administrator exports the current templates from production, both the out-of-the-box templates and any local ones, and writes down every place a standard template was edited, cloned or linked to local items, triggers and macros. Keep the export files in version control with the production Zabbix version noted. The step is done when you have a dated export set and a change register that lists each modified template, its item and trigger counts, and the reason for each edit. Ask the team that owns the templates to confirm the register is complete before moving on.
Build a staging copy at the upgraded version
The platform owner restores a recent production database backup into a staging environment, installs the target Zabbix server, frontend and proxies at the upgraded version, and connects a representative set of hosts or test hosts. Staging should use the same database engine and version as production, since the requirements page lists supported combinations per Zabbix release. The step is done when the staging frontend loads, the server reports no errors in its log, and the host, item and trigger counts match production within the expected drift from the backup time.
Back up the current staging templates
Before any import, export the current out-of-the-box templates from the staging copy so you have a rollback reference that matches the pre-upgrade state. Store the files with a label that names the source version. This matters because the template import method overwrites existing templates and the out-of-the-box documentation notes there is no option to review or undo those changes. The step is done when the backup files are stored separately and you have confirmed you can restore them into a scratch instance.
Import the target templates on staging
Import the target template set on staging using either single template imports through the frontend or a bundle import. The bundled import_templates.sh script updates all templates at once through the configuration.import API method, requires curl and jq, and overwrites every existing template, so use it only on staging where the backup from the previous step is ready. Run the import from a pinned template branch that matches the server version. The step is done when the import finishes without errors and the script output or frontend confirms the template versions you expected.
Diff the imported templates against production
Export the newly imported templates from staging and compare them with the production exports from the first step. Look for removed items, changed keys, altered trigger expressions, changed macros and template links that no longer match your register. Pay particular attention to edits that your team made in standard templates, because a bundle import replaces them silently. The step is done when every difference is either an intended vendor change or is recorded in the register as a local change that needs to be carried forward. Share the diff with the owners of affected hosts before continuing.
Re-apply local changes as separate custom templates
Move each local change out of the standard templates and into its own custom template that links to or is linked from the vendor template, so future bundle imports do not overwrite it. Where a change cannot be isolated, document it and plan a manual re-application. Use macros for thresholds where the template supports them. The step is done when the register shows each local change assigned to a custom template or a documented exception, and a re-export of the staging templates shows the standard templates match the vendor versions.
Test discovery, items and triggers on staging
Run low-level discovery on a sample of hosts and compare the discovered item, trigger and host prototype counts against production for the same hosts before the upgrade. Confirm that triggers fire for a controlled test condition, that notifications reach the expected test recipients, and that proxies still receive configuration. Check the server and proxy logs for template-related warnings. The step is done when the counts match except for changes you have already accepted, controlled test alerts behave as expected, and no unexpected template changes appear after a second export. Record the results so they can be repeated against production.
Schedule the production template update
Agree a production change window with the owners of the monitored estate and the people who receive alerts, and prepare the production rollback using the backup export from the third step. Repeat the import and the diff on production only with the same steps and files used on staging, then compare production counts with the staging results. The step is done when the change record names the template versions, the backup location, the verification results and the person who approved the window, and production triggers and discovery behave as they did on staging.
How template updates move from staging to production
The flow starts with a backup of the production templates, which is the rollback point for everything that follows. The same upgraded templates are then imported into a staging copy and compared with the local versions, so changes can be reviewed before anything reaches production. A review gate decides whether the full import or a targeted re-import of selected templates goes ahead. If production shows problems, the backup is the path back, because the import script overwrites existing templates and offers no undo.
Template updates are staged, compared and reviewed before production, with the backup as rollback.
How to keep local changes out of built-in templates
The safest way to keep site-specific work through an upgrade is to stop editing the out-of-the-box templates in place. Instead, clone the template you need into a custom template, add your local items, triggers, macros and tags to the clone, and link the clone to your hosts. When a bundle update later replaces the built-in template, the overwrite lands on Zabbix's own copy and your clone, with its own items and macros, stays intact. Put the clone in a naming convention your team can recognize, such as a site prefix, so nobody mistakes it for an upstream template during an upgrade review.
The trade-off is maintenance. A clone is a snapshot of the upstream template at the version you cloned it from, so when a new release adds items, triggers or discovery rules to the built-in template, your clone does not receive them. Someone has to compare the upstream template for each target version against your clone and decide what to copy across. Inheritance also needs checking after every upgrade: confirm that the hosts still link to the template you intend, that linked templates still resolve the macros you set, and that no trigger or item is now duplicated by a new upstream one. Confirm the exact template behavior for your version in the official Zabbix documentation on out-of-the-box templates before you rely on it, since item keys, macro names and linking rules can change between releases.
Security and access controls for template imports
Template imports replace every out-of-the-box template in one pass, so the people, credentials, backups and hosts behind an import carry as much risk as the template content itself. The cards below cover the controls to set before the first import and the evidence to keep after it.
Restrict import rights to administrators
Template import is a privileged change, so limit it to a small group of Zabbix Super Admin accounts on the frontend and to the API identities that run the import. Remove import rights from operator and read-write roles, and confirm the rule with a test account before the upgrade window. Check who can reach the Configuration menu for templates, because a user who can edit templates can also change the content that the next import would overwrite.
Scope API tokens to the import
The import_templates.sh script authenticates to the API, so give it a dedicated API token rather than a personal login or a shared admin password. Assign the token to a user whose role allows only the methods the import needs, and set an expiry so the token does not outlive the upgrade project. Store the token in your secrets manager, rotate it after the change window, and revoke it when the import is complete.
Protect the template export backup
Before importing, export the current templates and keep that file as your rollback source, since the script has no undo. Treat the export as sensitive configuration: it can reveal macros, item keys and any secrets stored in template macros. Store it in a location with the same access restrictions as the Zabbix database, limit read access to the people who run the upgrade, and confirm you can restore it before relying on it.
Record each change for audit
Keep a written change record for every template import that names the Zabbix version, the bundle or branch used, the operator, the approver, the time window and the export file that serves as the rollback point. Pair the record with the audit log entries that Zabbix writes for the import, and review them after the change. Auditors and internal reviewers will ask who changed a template and when, so the record should answer those questions without reconstruction.
Run the import from a trusted host
Run the script from a managed administration host that has a controlled network path to the Zabbix frontend or API, and limit its access to that endpoint. Avoid running it from a developer laptop or a shared jump host with unrelated tools. Confirm that curl and jq come from your approved package sources and that the script itself is taken from a version you have reviewed, because it will carry the token and push configuration changes.
Check the template source before import
Verify that the template files come from the official Zabbix source for your server version, and compare checksums or the Git tag against what you expected before loading them. A template from an unverified copy can add items, scripts or macros that run on every monitored host. Record the source and version in the change record so the import can be repeated or explained later.
Zabbix out-of-the-box templatesQuestions teams ask before updating Zabbix templates
Can our own team update Zabbix templates after an upgrade?
Yes, many teams do this in-house, provided someone owns the template work and has time to test it. The work is mostly comparison and testing: you need to know which out-of-the-box templates you changed, which hosts use them, and what the new version adds or removes. Teams with few local changes and a staging copy usually manage it with their existing staff. Teams with heavy customization, many dependent hosts or no staging copy tend to find the work takes longer than planned. Ask a partner for a written scope only if you want the comparison, testing and rollback plan done by people who do it regularly.
What makes the template update effort grow or shrink?
Three factors drive most of the effort. The first is the number of custom changes to out-of-the-box templates, since each one must be found, documented and re-applied or moved into a separate template. The second is the number of hosts, dashboards, host prototypes and low-level discovery rules that depend on those templates, because each dependency must be checked after the change. The third is staging maturity: a current, representative copy of production lets you test before anything changes, while building that copy adds work first. Ask any provider to break its quote down along these three lines.
Is import_templates.sh safe to run on a production Zabbix server?
Not without preparation. The script updates all templates at once through the configuration.import API method, needs curl and jq, and overwrites all existing templates with no option to review or undo changes. Any local edits to out-of-the-box templates are lost when it runs. Before using it, export your current templates, record every local change, test the run on a staging copy, and confirm that your custom templates are kept separate. Many teams prefer importing single templates or bundles so each change can be reviewed.
How do we roll back a template update that went wrong?
Rollback depends on having a copy of the previous state. Export every affected template and keep the exports, along with a record of the Zabbix version and the host and template links, before the change. The script does not offer undo, so restoring means importing those saved exports again, which is why exports must be taken first. Test the restore on your staging copy as well, so the procedure is proven before you need it. Confirm with your database backup policy too, since template data lives in the Zabbix database.
What does the team need to provide for the template update?
The work needs four things from your side. You need administrator access to the Zabbix frontend and API, with a dedicated account or API token for the import. You need a staging copy that matches production closely enough to show real template behavior, including the same Zabbix version and similar templates and hosts. You need a named owner who can decide which local changes to keep, and a change window agreed with the teams that receive alerts from those hosts. Confirm with your own security team how the API credentials are stored and who may use them.
Which Zabbix version and support timeline should shape our update plan?
Check your current version against the life cycle policy before deciding the timing. Zabbix 6.0 LTS limited support ends on 28 February 2027, and Zabbix 7.0 LTS has full support until 30 June 2027 and limited support until 30 June 2029. Zabbix 7.4 has full support until Zabbix 8.0 LTS. Confirm these dates against the official life cycle page before you set a schedule, because the release policy may change. Plan the template update as part of the platform upgrade so that templates match the server version.
When is it worth bringing in a partner for the template update?
A partner is worth considering when the update touches many custom templates, a large number of production hosts, or dashboards and alerting that other teams depend on, or when your team lacks time for testing. DeployOpen plans, implements and tests self-hosted platforms in your own infrastructure, and most engagements are fixed-scope with scope, deliverables and timelines agreed in writing before work starts. A quote follows from that written scope, so ask for the comparison, staging test, rollback procedure and handover to be listed separately. For paid vendor support, Zabbix lists tiers from Silver to Global, which is a different service from this work.
How DeployOpen scopes and delivers template updates
DeployOpen starts every template update with an inventory, not an import. The first step is to list which out-of-the-box templates are linked to your hosts, which of them carry local changes such as altered items, triggers, macros or discovery rules, and which dashboards, maps, host prototypes and alerting actions depend on them. Where a local change sits on a template that is also overwritten by a bundle, the team needs to know that before any file is touched. The inventory also records how the current templates were imported, because a bundle import and the import_templates.sh script handle existing objects differently and that choice drives the rest of the plan.
The method and test plan are then agreed in a written fixed scope before work starts. That document names the templates in scope, the chosen import path (single templates, a bundle, or the full script), the rollback approach, the checks that confirm each template still collects data and fires the expected triggers, and who signs off the result. The upgrade is run on a staging copy built from a recent configuration export and database snapshot, so the team can see the overwrite and the dependent objects before production. Ask any provider to confirm in writing whether the staging copy will be built from production data, how that data is protected, and what happens to the work if the staging run exposes a conflict that changes the scope.
DeployOpen documents the result for your operations team: what changed in each template, which local changes were kept or reapplied, which checks passed, and what to watch in the first production cycle. Ongoing support for template maintenance across future Zabbix releases is available as a retainer, which covers the recurring cost that a one-time upgrade does not. DeployOpen does not publish a price list, so a quote follows from the written scope. To compare quotes, ask each provider to itemize inventory, staging, production cutover, documentation and any retainer separately, and to state which of these depend on how many templates carry local changes.

