Backup & Rollback

The Deploy Forge WordPress plugin can automatically back up your theme before each deployment, allowing you to restore previous versions if something goes wrong. Backups are managed entirely within WordPress on your server.

Automatic Backups

When Create backups is enabled in the plugin settings (recommended), Deploy Forge:

  1. Creates a ZIP archive of your current theme directory
  2. Stores the backup locally on your WordPress server
  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 at wp-content/uploads/deploy-forge-backups/.

Each backup filename includes:

  • A unique identifier
  • 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 in WordPress admin
  2. Find a successful deployment you want to restore
  3. Click the Rollback button
  4. Confirm the rollback

The plugin will extract the backup ZIP and replace your current theme files.

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 from your server

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

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 in WordPress admin
  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 in WordPress admin
  2. Click Rollback on the last working deployment
  3. Your theme files are restored

"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