Database Backups

Resources used

Requirements

Configuring Forge Backups

  1. Navigate to your server in Laravel Forge. image
  2. If it's not already showing, open the "New Backup Configuration" panel.
  3. Capture the following details: image
    • 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
  4. Click "Save"
  5. Once the configuration has been saved, test that it works by clicking "Run". image

Restore from a Backup

In the event we need to restore from a backup, here are the steps to do so:

  1. Navigate to the "Backups" section on your server in Laravel Forge.
  2. You will see a list of "Recent Backups". These are the automated backups that have been made
  3. Click the "Restore" link for the database backup in the list you want to restore image
  4. You will see a confirmation modal telling you this action cannot be undone. Click "Yes" to start the restore process
  5. 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.