Behind the scenes FusionCMS uses spatie/laravel-backup. For more detailed reading on the subject visit their documentation. This article will more focus more on it's setup surrounding FusionCMS.
Let's discuss two approaches to running a backup. One is a manual approach from the Control Panel, and the other can be setup to run automatically.
- Navigate to Tools > Backups from the sidebar.
- Click Backup Now in the top-right of the screen to request a backup.
Fusion\Jobs\Backups\BackupRunwill run in the background on a queue. For more information on leveraging queues in your workflow visit Laravel Queues.
Instead of manually requesting backups, it's possible to have backups taken automatically through a cron job using Laravel's Task Schedule system.
Enabling Automatic Backups & Cleanup
- Navigate to Settings > Backups.
- Set Auto Backups to Enabled.
After enabling Auto Backups, FusionCMS will run both Backup and Cleanup jobs once per day.
Important: In order to successfully have auto-backups taken, you'll first need to setup your own cron job to call the
schedule:runArtisan command. For more information, read this article.
If you come across a backup that has failed, you can always view the Backup Log from the Control Panel.
From the Control Panel you'll be able to take further actions on a Backup
- Restore Backup - Restore FusionCMS to this backup.
- Download Backup - Download backup zip file.
- Delete Backup - Confirm the removal of a Backup record.
- Scheduled Backups - Auto-backup enabled.
The following Notifications can be subscribed to from the User interface:
- Backup Was Successful - Backup has successfully completed.
- Backup Has Failed - Backup has failed to complete.
- Cleanup Was Successful - Cleanup process has successfully completed.
- Cleanup Has Failed - Cleanup process has failed to complete.
You can view more information about failed jobs from the Backup interface.
For more information on events to hook into, check out the following pages: