Share

Backup and recovery

What to back up

WhatWhy
The databaseeverything: users, organisations, monitors, results, incidents, settings, plans, invoices
includes/config.phpdatabase credentials, site URL and AIM_SECRET_KEY
uploads/logos, favicons, payment proofs
storage/logs, cache, cron lock, probe/agent spools on the main host (useful, not vital)

The application files themselves come from the release ZIP; you do not need to back them up.

The AIM_SECRET_KEY warning. Every stored credential (alert channel settings, HTTP auth passwords, API keys in monitor configs, integration credentials, SMTP password, gateway secrets) is encrypted with this key, and every token (API, probe, agent, reset, remember-me) is hashed with it. A database restored without the matching config.php has unreadable channel settings and every token stops working: probes and agents would have to be re-registered and API tokens re-created. Back the file up together with the database, and never regenerate the key on a live installation.

Database dump

mysqldump --single-transaction --quick --routines --default-character-set=utf8mb4 \
  -u DBUSER -p DBNAME | gzip > aim-$(date +%F).sql.gz

--single-transaction takes a consistent snapshot of the InnoDB tables without locking the live site. On a big installation the result and metric tables dominate the dump; if you only need a disaster-recovery copy you may exclude them (--ignore-table=DBNAME.monitor_results --ignore-table=DBNAME.server_metrics): the daily and hourly roll-ups keep the uptime history, only the raw rows of the retention window are lost.

A nightly cron line:

30 3 * * * mysqldump --single-transaction --quick -u DBUSER -pPASS DBNAME | gzip > /backups/aim-$(date +\%F).sql.gz && find /backups -name 'aim-*.sql.gz' -mtime +14 -delete

Copy the dumps and the files off the server (object storage, another host). cPanel users can also use the account backup, which includes the database and the files.

Restore

  1. Install the same (or a newer) release into the folder; do not run install.php.
  2. Put back includes/config.php, uploads/ and storage/ (create storage/ empty if you have no copy; it is recreated as needed).
  3. Create the database and load the dump: gunzip < aim-2026-11-03.sql.gz | mysql -u DBUSER -p DBNAME.
  4. If the host or site URL changed, edit SITE_URL in config.php (or Admin → Settings → General) and the database credentials.
  5. Create installed.lock (echo restored > installed.lock) so the installer does not start.
  6. Open db_update.php once if the release is newer than the dump.
  7. Add the cron line again and check Admin → System health: cron running, probes and agents reporting (their tokens still work because the key is the same).

Moving to another server

Same steps as a restore: dump, copy the files, load, adjust SITE_URL, re-add the cron, then update the DNS. Probes and agents follow the hostname, so keep it; if the hostname changes, re-register them with the new URL (aim-probe.php --register, aim-agent register).

What is not backed up by the platform

The platform does not back itself up. Admin → System health shows the database size so you can see the growth; the retention settings of the plans decide how much raw history is kept.

Was this page helpful?

One click helps us improve these docs.

Share this pagePlain links - no trackers, nothing loaded until you click.