Backup & Rollback

Deploy Forge automatically backs up your theme before each deployment, allowing you to instantly restore previous versions if something goes wrong.

Automatic Backups

When Create backups is enabled (recommended), Deploy Forge:

  1. Creates a ZIP archive of your current theme directory
  2. Stores the backup linked to the deployment record
  3. Proceeds with deploying the new version

If the deployment fails partway through, you still have the backup to restore from.

Backup Storage

Backups are stored in your WordPress uploads directory:

wp-content/uploads/deploy-forge-backups/
├── backup-123-2024-01-15-143052.zip
├── backup-124-2024-01-16-091523.zip
└── backup-125-2024-01-17-162341.zip

Each backup filename includes:

  • Deployment ID
  • Date and time of backup

Backup Contents

Backups include your entire theme directory:

  • All PHP files
  • CSS and JavaScript files
  • Images and assets
  • Template files
  • Everything in wp-content/themes/your-theme/

Performing a Rollback

To restore a previous version of your theme:

  1. Go to Deploy Forge → History
  2. Find a successful deployment you want to restore
  3. Click the Rollback button
  4. Confirm the rollback

Deploy Forge will:

  1. Extract the backup ZIP
  2. Replace your current theme files
  3. Mark the original deployment as "Rolled Back"

The rollback completes in seconds.

Rollback Requirements

You can only rollback if:

  • The deployment was successful (failed deployments have no deployed files to restore)
  • A backup exists for that deployment
  • The backup file hasn't been deleted

What Gets Restored

Rollback restores theme files only:

  • All files from the backup are copied to your theme directory
  • Database changes are NOT rolled back
  • Plugin settings are NOT affected
  • Media uploads are NOT affected

If your deployment included database migrations or option changes, those won't be reverted automatically.

Managing Backups

Disk Space

Backups can consume disk space over time. Monitor your usage:

  • Each backup is roughly the size of your theme
  • A 10MB theme with daily deployments = ~300MB/month of backups

Automatic Cleanup

Deploy Forge can automatically delete old backups. Configure retention in settings:

  • Keep backups for X days
  • Keep last X backups
  • Delete backups when deployment is deleted

Manual Cleanup

You can safely delete old backup files via FTP/SFTP:

# Delete backups older than 30 days
find wp-content/uploads/deploy-forge-backups/ -name "*.zip" -mtime +30 -delete

Or delete specific backups through your hosting file manager.

Disabling Backups

If disk space is limited or you have other backup systems:

  1. Go to Deploy Forge → Settings
  2. Disable Create backups before deploying
  3. Save settings

Warning: Without backups, you cannot rollback deployments. Only disable if you have alternative recovery options.

Recovery Scenarios

"My site is broken after deployment"

  1. Go to Deploy Forge → History
  2. Click Rollback on the last working deployment
  3. Your site is restored in seconds

"I need to restore from 3 deployments ago"

  1. Go to Deploy Forge → History
  2. Find the specific deployment you want
  3. Click Rollback (works for any deployment with a backup)

"The backup file is missing"

If the backup ZIP was deleted:

  • You cannot rollback that specific deployment
  • Check if you have external backups (hosting provider, backup plugin)
  • Deploy a known-good commit manually

"Rollback didn't fix the issue"

The problem might not be in theme files:

  • Check for database changes that need reverting
  • Check plugin settings or configurations
  • Review the deployment logs for what changed

Best Practices

  1. Keep backups enabled - The disk space cost is worth the safety net
  2. Test rollbacks - Try a rollback on staging to understand the process
  3. Monitor disk space - Set up alerts if backup storage grows too large
  4. Have external backups - Deploy Forge backups complement, not replace, full site backups
  5. Document database changes - If deployments include migrations, document how to reverse them