How to manually backup FreePBX Legacy if errors using Web GUI or fwconsole
If encountering errors with fwconsole during FreePBX legacy backups, a manual backup approach can be employed by directly backing up the relevant files and databases.
1. Backup FreePBX Configuration Files:
- Copy the entire /etc/asterisk directory, which contains Asterisk configuration files.
 - Copy the FreePBX web interface files, typically located in /var/www/html/admin or /var/www/html/freepbx.
 
2. Backup Asterisk Voicemail and Recording Files:
- Copy the /var/spool/asterisk/voicemail directory.
 - Copy the /var/spool/asterisk/monitor directory (if call recordings are stored there).
 
3. Backup FreePBX Database:
- Identify the database used by FreePBX (usually MySQL/MariaDB).
 - Use mysqldump to create a backup of the asterisk database and potentially asteriskcdrdb.
 
Code
mysqldump -u -p asterisk > /path/to/backup/asterisk_db_backup.sql
mysqldump -u -p asteriskcdrdb > /path/to/backup/asteriskcdrdb_backup.sql
NOTE: A common location for backups is /var/spool/asterisk/backup/default so replace /path/to/backup with /var/spool/asterisk/backup/default- Replace and with your database credentials and /path/to/backup with your desired backup location.
 
4. Combine and Compress Backups:
This manual process provides a comprehensive backup of the critical FreePBX components, serving as a fallback when fwconsole backups are not functioning correctly.
- After backing up the necessary files and databases, combine them into a compressed archive (e.g., a .tar.gz file) for easier storage and transfer.
 
Code
tar -czvf /path/to/backup/freepbx_manual_backup_$(date +%Y%m%d).tar.gz \
/etc/asterisk \
/var/www/html/admin \
/var/spool/asterisk/voicemail \
/var/spool/asterisk/monitor \
/path/to/backup/asterisk_db_backup.sql \
/path/to/backup/asteriskcdrdb_backup.sql
