In FreePBX 15 our backup module was redesigned for simplicity, flexibility and maintainability. Storage options are now handled in the Filestore module which offers more options to keep your data safe. You can now backup per module. This allows you to create custom backups of just the data you need. You can also divide your modules in to different backups for data that may change more often. With each module handling the data it owns we can now do cross-version backup and restore (15+).
Creating backup jobs
If you are migrating from a previous version, your backup jobs will migrate on install including creating Filestore locations.
If this is a new install, your first step is to create a Filestore location. For information on doing this please see the Filestore documentation Here.
Backup Job Creation
|Step 1: Click on the "Add Backup" button|
Step 2: Give your backup a name and description.
|Step 3: Click the "Modules" button|
Step 4a: Choose the modules to backup. You can click the box in the header to select all.
Some modules will have their own settings which will be available by clicking the plus symbol.
|Step 4b: Click "Save Changes"|
Step4c: Add Custom directory to backup file.
this is important , if we want to add any custom data/files to backup file. By default it shows "ASTETCDIR" to include *_custom.conf files into the backup. If we want we can remove this directory as well.
Also, By default "recording" files are not adding to Backup file so If we want to add "recording" files then we can add "ASTSPOOLDIR/monitor" directory into this custom file.
|Step 5: Select your notification preferences. If there is no email address notifications will be disabled. Note notifications emails may be filtered as spam by your ISP. If this happens you can typically whitelist the sender email address.|
|Step 6: Choose where to store the backup. You can select as many locations as desired.|
If you would like to save the backup jobs like <filestore-path>/<backup-job-name>/<backup-file> then enable " " option. By default this option is NO which means backup file will always store to "filestore" defined path i.e. "<filestore-path>/<backup-file>"
|Step 7: Decide if you want to run this backup automatically. To do so, set enabled to "Yes" and select the schedule. Only the options available to the selection type will be enabled. By default these are all set randomly.|
Step 8: Decide if you want the module to do housekeeping. Backups can be limited by number of runs only keeping the last X backups. They can also be kept until they reach a certain age. For "Delete After Runs" 0 is unlimited.
|Step 9: Decide if this backup is a warm spare. See documentation HERE for warm spare setup.|
|Step 10: Save your backup.|
|a||Select where you want to be from the tabs|
|b||Button to create a new backup|
|c||The name of your backup.|
|d||A description of the backup|
|e||Backup actions. Edit, Run, Show CLI command and Delete|
|f||Search for your backup job in cases where you have many backups to filter through.|
You can copy the command from the ">_" icon and run the backup from an ssh session. A list is also available in the CLI
To run a backup use the "Backup ID"
On a new install you can run the restore by uploading a backup file, or restore a previously saved backup on an existing install.
From this window you can also download and delete stored backups.
After running or uploading a backup you will go to a confirmation screen.
Here you will see the description of the backup job to be run including the modules backed up, and decide to run the restore or go back to the restore page.
You can restore the backup from the command line
Note the same warnings from the UI apply but there is no confirmation on the cli.
15+ CLI Commands
Please refer to fwconsole commands (15+)#Backup to know details about Backup module related CLI commands applicable for FreePBX 15+ systems.
To see what is in the backup you can check the manifest. The manifest is returned in json and can be processed through automated methods. Note backups are PHAR files and can be natively accessed through php's PharData class.