Asterisk backup and restore planning
A configuration directory is only part of a recoverable phone system. Identify which data, software and external services are needed to recreate the intended calling behaviour, then document their restoration order.
Source-reviewed, 19 October 2026. Prepared from the cited documentation. This recovery plan has not been independently exercised by Phone Guides. Scope: Asterisk 22 recovery design; backup commands, database consistency and managed-product procedures depend on the installation.
Inventory what the system uses
| Component | What to preserve or document |
|---|---|
| Software and modules | Exact release/package, build choices, update source and required modules |
| Configuration | Effective files, includes, database-backed settings and configuration owner |
| Runtime data | AstDB and application data actually used by the dialplan |
| User content | Voicemail, announcements, music on hold and recordings within the chosen retention scope |
| Security material | Protected certificates, private keys, access controls and secret-management references |
| External services | Database schemas/data, mail delivery, API integrations, provider and DNS/firewall dependencies |
| Host integration | Runtime user/groups, directory ownership, service units and OS policy |
Use the official directory reference to identify categories and core show settings to inspect effective locations. Do not assume every installation keeps them at the sample paths. If a managed PBX owns the configuration, include its documented backup process and related data.
Before scheduling a backup, record the effective paths from the running instance and map each used path to its backup method:
| Asterisk location or dependency | Typical contents to check | Recovery note |
|---|---|---|
astetcdir |
Configuration files and included fragments | Preserve the configuration owner and any generated/managed-file ownership rules |
astdbdir |
Asterisk's internal database | Use a consistent database-aware capture method or a service/filesystem snapshot designed for it |
astvarlibdir and astdatadir |
Application data, sounds, prompts and locally installed assets | Include only the paths and custom material the dialplan uses |
astkeydir |
Private keys and related security material | Store separately with restricted access and a tested restore path |
astspooldir |
Voicemail, recordings, monitor output, outgoing work and temporary files | Choose which user content and transient work must survive; do not blindly restore stale queued work |
| External database or service | Realtime objects, voicemail, reporting, speech or application state | Capture schema, data, credentials through the secret process, and service-specific restore order |
The Asterisk directory reference describes the normal roles of these paths, including the AstDB file and spool subdirectories. Use the effective values from asterisk.conf or the running settings, since local builds and managed distributions can change them. Keep a backup manifest with the exact release, module/build choices, path, owner, permissions, capture time, consistency method, encryption/custody reference and restore procedure for each item.
Treat databases as databases
The AstDB reference describes Asterisk's internal persistent store. A raw copy of a file being written is not automatically a consistent database backup. Choose a backup method compatible with the database engine and service state; document whether writes are paused and how consistency is established.
For external realtime databases, preserve the schema and data needed by that exact release. The realtime documentation explains that configuration may live outside plain-text files. Include database credentials through a protected recovery mechanism rather than printing them in the runbook.
Define the backup set and custody
Decide how much voicemail and recording history recovery must include, who can read it, how long backups are retained and where an independent copy is held. Protect backups containing subscriber information and secrets. An accessible copy on the same failed disk does not satisfy a separate recovery copy requirement.
For each backup job, record its completion status, consistency method, protected destination and restoration instructions. Avoid a broad archival command that silently misses a custom data directory or creates an unencrypted bundle of credentials. An OS snapshot may be useful, but still document its application/database consistency and external-service limits.
Write the restoration sequence
- Recreate the documented OS/service environment and correct Asterisk release/modules.
- Restore configuration and application data using the chosen consistency method.
- Restore protected security material, ownership and permissions through the approved secret path.
- Reconnect databases and required external services with production calling isolated until checks are complete.
- Start the intended Asterisk instance, inspect startup errors, version, settings and loaded objects.
- Check routes, registrations, ordinary calls, audio, voicemail and required integrations before returning traffic.
Keep the existing working service available where possible while checking a replacement. Do not allow two restored instances to compete for the same provider registration as an incidental recovery test. Provider behaviour and failover must be established for the actual service.
First boot on an isolated replacement
Restore to a host or network segment that cannot place external calls or claim production registrations. Before starting Asterisk, verify the intended binary/package and module set, configuration ownership, security-file permissions, database restore state, and that no old call files or temporary work will be replayed. Then inspect the running release, effective directories, loaded modules and the objects owned by the configuration path. Fix parse/load errors before allowing calls.
Check one item from each required data path: a PJSIP endpoint and its auth/AOR relationships, internal route, voicemail mailbox and message, a retained recording, AstDB value if the dialplan uses it, and each required external integration. Perform an internal call and check two-way media, DTMF and hangup cleanup where those functions matter. Use a specific check only for features the system actually runs. Keep a record of missing files, changed schema, permissions, unavailable services and any data restored from a different point in time.
The Asterisk backup guide says restoring to a new major version follows the upgrade path because configuration, database schema, applications and functions may differ. Keep recovery on the same major release until the restore is established; if changing major versions, use the matching upgrade procedure as a separate change with its own configuration and behaviour checks. A usable archive or a successful Asterisk start alone does not prove that user data, routes or media have been recovered.
Know what counts as evidence
A completed backup job establishes that the job produced an output. Recovery confidence requires a readable backup and a successful restoration check appropriate to the system. Record your own results when you perform that check; this guide does not claim that Phone Guides has restored your configuration.
For reader verification, compare the recovered configuration, version and data with the recorded target, then follow a call checklist. Preserve the evidence and any missing dependencies. The upstream maintenance and upgrade documentation is a further reference when recovery also changes software versions.
Continue with files and CLI or troubleshooting. Return to Asterisk documentation.