Skip to content

Run a Backup

The Backup module captures UnifiedBX configuration (database + relevant files) into a tarball. Run before major changes (module updates, version upgrades, big config changes) and on a schedule.

Before You Start

  • Storage has space (backups can be 100MB-2GB depending on system size).
  • A Filestore location is configured if you want offsite backups (see Configure Filestore).

Run a one-off backup

  1. Go to System Admin → Backup & Restore.
  2. Click Backups tab.
  3. Click + Add Backup if no template yet, or trigger an existing template.
  4. Configure (for new template):
    • Backup Name — e.g. Daily Full.
    • Description — what it covers.
    • Items to Backup — check all categories: System, FreePBX, Asterisk, CDR, Voicemail, System Recordings, etc. For most installs, leave default (everything).
    • Storage Locations — pick destination(s) (Local, FTP, S3, etc. — must be configured in Filestore first).
    • Pre / Post Hooks — optional shell scripts to run before/after.
    • Maintenance — how many backups to retain. e.g. keep last 7.
  5. Click Submit.
  6. Click the Run Now icon next to the template to execute immediately.
  7. Click Apply Config.

Schedule recurring backups

  1. On the same backup template, scroll to Schedule.
  2. Pick frequency: daily, weekly, custom cron.
  3. Pick time of day (off-peak hours).
  4. Submit.

Verify

Watch the backup run on the Backup History tab — duration, size, success/failure.

ls -la /var/spool/asterisk/backup/<backup-name>/

The tarball should be there with a recent timestamp.

What's in a Backup

  • Asterisk MySQL databases (asterisk, cdr, asteriskcdrdb, freepbx).
  • /etc/asterisk/ config files.
  • /var/lib/asterisk/sounds/custom/ (custom recordings).
  • /var/spool/asterisk/voicemail/ (if Voicemail is checked).
  • /var/spool/asterisk/monitor/ (if Recordings is checked — these are LARGE).
  • System config (network, firewall, sysadmin).
  • Module list (so Restore can reinstall).

Common Issues

  • Backup fails silently. Check Backup History for errors; tail /var/log/asterisk/freepbx.log during a manual run.
  • Backup huge / slow. Recordings included. Either exclude (separately back up /var/spool/asterisk/monitor/) or accept the size.
  • No remote backup happening. Filestore destination not configured properly. Test the destination from Filestore module first.
  • "Cannot connect to MySQL" during backup. mysqldump credentials wrong; usually means /etc/freepbx.conf lost permissions or password changed. Check.
  • Disk fills with backups. Maintenance setting (retention) not set. Set to 7 and enable.