4.6 KiB
Restore Cacti on a replacement server
A restore is complete when an operator can open a graph from before the backup, see a new sample from a test device, and access only the graphs their account is allowed to see. Rehearse on an isolated replacement host. Record the recovery point (newest recovered sample) and the time required to return the service to operators.
Prepare a recoverable backup
- Record the Cacti, PHP, MariaDB/MySQL, RRDtool, collector and plugin versions. Record the main and remote collector IDs, polling schedules, database names and actual RRD paths. Select a known graph and write down its device, data source, collection interval and a recent non-empty time range. Capture an allowed and a restricted graph ID for a test user.
- Inventory the database, RRDs, Cacti configuration, plugin code and plugin-owned files, custom scripts, query XML, certificates, encryption keys and scheduler configuration. Include remote databases, external plugin databases and non-default storage paths where used. Protect keys and database credentials with the backup's access controls.
- Choose a coordinated recovery point. For a scheduled cold backup, pause new polls, web writes and plugin jobs, let active jobs finish, and flush pending Boost or RRD cache writes through the configured service. Take the database and filesystem copies while writes remain paused. Resume the original services and confirm a new poll completes. For an online snapshot, document how the database and RRD recovery points are coordinated and how much divergence is acceptable.
- Check the backup manifest, file sizes and checksums. Retain the time range you captured in step 1 as an independent verification target.
For example, on MariaDB the following creates a logical dump. Run it with an account allowed to read the indicated objects, in a protected backup directory. Supply credentials through the client's protected option file. The consistent transaction covers transactional tables. Coordinate writers to any nontransactional plugin tables when taking the copy.
umask 077
mariadb-dump --single-transaction --quick --routines --events --triggers \
--databases cacti > cacti.sql
Use the matching client utilities for your database distribution. Check the command's exit status and restore the dump during the drill.
Restore without contacting production
- Isolate the replacement from production databases, devices, remote collectors, mail relays and webhooks before loading data. Leave cron, timers, pollers, plugin jobs and the database event scheduler stopped or disabled. A restored database can contain live recipient settings.
- Install matching versions. Restore the database into an empty instance.
For the example dump, run
mariadb < cacti.sqlon the replacement with its local restore account. Recreate the application account and grants. Confirm the configured database hostname resolves to the replacement. - Restore configuration and keys, RRD files, plugins and local resources
at their recorded paths. Restore service-account ownership and access.
If the target cannot read a binary RRD from the source platform, use
RRDtool's dump and restore on the respective platforms. Check one file
with
rrdtool infobefore converting the full set. - Start the web and database services in isolation. Open the saved historical graph window. Verify a known value or pattern and timestamp. Check an enabled plugin page and its retained configuration.
- Permit a lab device and a test notification sink only. Exercise the poller on a lab data source for two scheduled intervals. Confirm its RRD timestamp advances and its graph has a new finite value. Sign in as the restricted user and test both saved graph URLs.
Decide whether to cut over
Record historical coverage, fresh sample time, access results, any missing plugin data and elapsed restore time. A stale graph or a credential that cannot be decrypted is a failed check to investigate before cutover. For a planned move, agree on a final synchronization window and which host will own the schedule. Stop the old writers before enabling the new ones. Keep the prior host and backup available for rollback, and account for samples collected after the cutover if you revert.
See Upgrading Cacti for version changes and diagnose a stale graph for missing samples.
The MariaDB dump reference describes the backup switches.
Copyright (c) 2004-2026 The Cacti Group