Database Backups
Resources used
Requirements
- Backups run 4x daily
- Backups are saved to DigitalOcean Spaces
- We keep at least 14 days worth of backups, 56 backup files
Configuring Forge Backups
- Navigate to your server in Laravel Forge.
- If it's not already showing, open the "New Backup Configuration" panel.
- Capture the following details:
- Frequency:
Custom
- Custom Frequency:
15 */6 * * *
- Provider:
DigitalOcean Spaces
- Region: Choose a region closest to the client/resources
- Bucket: Enter the bucket name for the project
- Access key:
access key in Bitwarden
- Secret key:
secret key in Bitwarden
- Storage directory:
db-backups/
- Backup retention:
56
- Notification email: FC Engineering email address
- Databases: Select the production DB from the list
- Frequency:
- Click "Save"
- Once the configuration has been saved, test that it works by clicking "Run".
Restore from a Backup
In the event we need to restore from a backup, here are the steps to do so:
- Navigate to the "Backups" section on your server in Laravel Forge.
- You will see a list of "Recent Backups". These are the automated backups that have been made
- Click the "Restore" link for the database backup in the list you want to restore
- You will see a confirmation modal telling you this action cannot be undone. Click "Yes" to start the restore process
- Once it has completed, depending on the database size you may need to wait a few minutes for database to fully be restored.
Note: Once the restore has completed, you may need to clear out Craft's "Data caches" if you are still seeing cached data in the CP.