# Database Backups
# Overview
Forge supports automated database backups that can be scheduled directly from your server's Forge dashboard. You can choose to backup one or more databases at a specified frequency and also restore any of your recent backups. The backup script used by Forge is open source and can be found on GitHub (opens new window).
Business Plan Only
Database backups are only available on the Business plan.
# Creating Backup Configurations
# Storage Providers
You can choose to backup your databases to:
- Amazon S3
- DigitalOcean Spaces
- Custom (S3 Compatible)
For Amazon S3 and DigitalOcean Spaces storage providers you need to provide Forge with:
- The region your backup should be stored in (
eu-west-2
,nyc3
etc..) - The name of the storage "bucket"
- The access / secret keys that should be used to connect to the storage service
AWS IAM Permissions
When using Amazon S3 to store your database backups, your AWS IAM user must have write permissions for S3.
When using a custom, S3 compatible provider, you must supply:
- The service endpoint / URL
- The name of the storage "bucket"
- The access / secret keys that should be used to connect to the storage service
You can also choose to provide a storage directory where backups will be restored relative to your bucket root. If left empty, backups will be stored within the root of your bucket.
# Frequency Options
Within the Forge database backup dashboard, you can select the frequency at which your database should be backed up:
- Hourly
- Daily (at a given time)
- Weekly (on a given day and time)
When using the API to create a Daily or Weekly backup, you may provide any valid time (e.g. 13:37
) to your schedule; however, for the sake of simplicity, the Forge UI allows you to select a time in 30 minute intervals. The time you select should be in your local time as reported by your web browser.
# Customizing The Frequency
If you need to customize the frequency further, you may manually edit the /etc/crontab
entry for the backup configuration on your server.
Editing Cron Entries
Extreme caution should be taken when editing the /etc/crontab
file. Any misconfigurations will prevent all cron entries from running.
# Backup Retention
Forge will automatically prune old backups for you. For example, if you have configured a backup retention rate of "five", only the last five backups will be stored within your storage provider.
# Notifications For Failed Backups
You may provide an email address to be notified when a backup fails. If you need to notify multiple people, you should create a distribution list such as [email protected]
.
Forge will also display failed backups within the Backups panel of the Forge server's management dashboard.
# Managing Backups
# Deleting Backup Configurations
You can delete a backup configuration by clicking the Delete button next to your chosen backup configuration under the Backup Configurations section of the server's Backups dashboard.
Backup Archives
When deleting a backup configuration, your backup archives will not be removed from cloud storage. You may remove these manually if you wish.
# Restoring Backups
You can restore backups to your database via the Recent Backups section. Click the Restore button next to your chosen backup. Backups will be restored to the database they were created from. If the backup configuration contains more than one database, you will be asked to select which database to restore.
If you need to restore a backup to another server or database you may download the backup archive from your cloud storage provider and restore it using a database management tool such as TablePlus (opens new window).
# Deleting Backups
If you need to delete an individual backup, you can do this by clicking the Delete button next to the backup.
Deleting Backups
When deleting a backup, your backup archives will be removed from your cloud storage provider. Please take caution when removing backups.
# Backup Output
Each backup process will create its own log so that you can inspect the database backup process's output in the event of a failure. You can view the output of a backup by clicking the "Eye" icon next to your backup.