Local Backups Documentation

SSP — Backups (Docs)

SSP Documentation

SSP Backups

Overview

SSP Backups creates automatic or manual WordPress backups and stores them locally in wp-content/uploads/ssp-backups. You can back up specific components (Database/Plugins/Themes/MU-Plugins/Uploads) or your entire WordPress root. Retention is smart and rolling, or you can keep a fixed newest count. One-click Restore is available for local backups.

Key Features

  • Flexible schedules: daily, weekly, monthly at a local time you choose.
  • Single searchable timezone input (city/region IDs; DST-aware).
  • Smart retention (last 30 days daily/weekly + 12 months monthly) or Keep newest N.
  • Manual Run Backup Now, Download/Delete, and Restore (local-only).

What’s Local

  • Backups are ZIP archives saved on the site’s filesystem.
  • Remote exports are disabled by design.
  • Includes best-effort database dump (if checked).

Safety

  • Lock files prevent overlapping runs.
  • Restore uses maintenance mode and attempts rollback on failure.
  • Backup directory is protected via .htaccess and index.php.
Note: This plugin does not send backups off-site. Ensure you have sufficient local disk space.

Admin Screen

The plugin adds a top-level menu SSP Backups with a single page:

Run & Actions

  • Run Backup Now — immediately creates a backup using current settings.
  • Per-backup actions: Download, Restore, Delete.

Settings

  • Scope: Selected components vs Entire site.
  • Retention: Off, Smart (30×/12m), or Keep newest N.
  • Timezone: searchable city/region IDs.
  • Schedule: Frequency + Time; weekday/month-day controls appear contextually.

Existing Backups

  • Table lists File, Date (in your timezone), Size, Contents, Actions.
  • “Contents” indicates whether the archive is entire root or a components set.
Tip: Saving settings reschedules the next WP-Cron run per your new schedule/timezone.

How It Works

  1. On activation, the plugin creates wp-content/uploads/ssp-backups and schedules the next run.
  2. Each run creates ssp-backup-YYYYMMDD-HHMMSS.zip. Depending on scope, it includes selected folders and optionally a database.sql dump.
  3. After creation, the retention policy may prune older backups.
  4. Manual Run Now uses the same pipeline and shows a notice with filename and size.
Normalization & Limits: The export skips volatile caches and the backup folder itself. ZIP requires PHP’s ZipArchive.
Performance: Large Uploads or “Entire site” may be heavy. Ensure time/memory limits are adequate on your host.

Scope & Components

Selected Components

  • Database (SQL dump)
  • Plugins, Themes, MU-Plugins, Uploads
  • Optionally includes wp-config.php for convenience.

Entire Site

  • Copies the WordPress root tree (minus excluded caches/backup directories).
  • Database dump is still controlled by the Database checkbox.
Settingscope = components | entire
Componentscomponents[] in {db,plugins,themes,muplugins,uploads}
Note: When Entire site is selected, the components grid mainly decides whether to include the database dump.

Timezone Picker

The Timezone field is a single searchable input connected to a datalist of IANA region IDs (e.g., America/New_York). This ensures daylight-saving time is handled correctly when scheduling.

  • Accepts valid timezone identifiers only.
  • Displays a friendly name (e.g., “Eastern Standard Time”).

Scheduling

Frequency & Time

  • Daily: runs every day at your selected Time of day.
  • Weekly: choose a Day of week and a Time.
  • Monthly: choose a Day of month (If a month is shorter, it runs on its last day) and a Time.
Saving settings clears pending events and schedules a single next run in your timezone; after it fires, the plugin schedules the next one.

Retention

Modes

  • Off — keep all backups.
  • Smart (30× / 12m) — plus always keep latest:
    • With Daily schedule: one per day for last 30 days, and one per month for last 12 months.
    • With Weekly schedule: one per week for last 30 days, and one per month for last 12 months.
    • With Monthly schedule: the smart option is hidden (not applicable).
  • Keep newest N — deletes older ones beyond the limit (1–200).

Grouping Basis

  • Grouping uses the backup file modification time (filesystem clock) in your configured timezone.
  • Latest backup is always preserved.

Manual Runs & Locks

  • Run Backup Now respects your current scope, components, and timezone.
  • While a backup is running, a lock file .backup.lock prevents concurrent runs.
  • Scheduled runs use the same lock to avoid overlap; if locked, the run is re-scheduled.
Heads-up: On very large sites, increasing PHP memory/time limits may be necessary during the run.

Existing Backups

Backups are shown newest first with:

  • File — e.g., ssp-backup-20240131-030000.zip
  • Date — formatted in your selected timezone.
  • Size — human-readable.
  • Contents — Entire root vs specific components (Database/Uploads/Plugins/Themes/MU-Plugins).
  • Actions — Download, Restore, Delete (with nonces and confirmation prompts).
Location: wp-content/uploads/ssp-backups

Restore (Local Backups Only)

Restore extracts the selected ZIP and replaces files within wp-content/(plugins|themes|mu-plugins|uploads). If a database.sql is present, it is imported.

Safety Flow

  • Pre-checks: ZipArchive availability, disk space, writability.
  • Enters maintenance mode (creates .maintenance) during restoration.
  • Keeps a database dump (best-effort) and rolls back files on failure.

Rollback

  • On failure, attempts to restore previous directories and import the “before” database dump.
  • Maintenance mode is removed after completion (or on shutdown if created by the plugin).
Warning: Restore will overwrite files and may alter your database. Always test on staging first.

Security & Files

  • Backup directory gets a .htaccess to deny direct web access and a blank index.php.
  • Only users with manage_options can run, download, delete, or restore.
  • All file operations validate paths within the backups directory.
Locks.backup.lock (backup) and .restore.lock (restore) prevent overlap.
ExclusionsCommon cache/backup directories, node_modules, VCS folders, and the current ZIP being written.

Troubleshooting

“ZipArchive not available”

Install/enable the PHP Zip extension on your host. Without it, creating or restoring ZIPs isn’t possible.

Backups aren’t running on schedule
  • Confirm WP-Cron is active; low-traffic sites may benefit from a real system cron hitting wp-cron.php.
  • Re-save settings to reschedule the next event (check timezone/time).
“A backup is already in progress”

Wait for the previous run to finish. The plugin uses a lock file to avoid concurrent backups.

Restore failed
  • Ensure sufficient free disk space and writable wp-content.
  • Check the admin notice for the exact failure (extraction vs DB).
  • The plugin attempts rollback; verify your site and try again if needed.
Backups are too large
  • Use Selected components and exclude Uploads or large plugins/themes if not needed.
  • Consider pruning older media or adding server-side compression tools.

Test / Verification

  1. Open SSP Backups and set Timezone to your region (e.g., America/New_York).
  2. Select Selected components with Database + Plugins + Themes. Set schedule to Daily at 03:00.
  3. In Retention, choose Smart (30× / 12m). Save settings.
  4. Click Run Backup Now. After it completes, confirm a new ZIP appears with today’s timestamp.
  5. Use Download to verify the archive opens and contains expected folders / database.sql.
  6. Create a second backup; confirm retention still keeps both (latest is always kept).
  7. Optionally, test Restore on a staging site and confirm maintenance mode and completion notice.
Tip: If you switch to Weekly or Monthly, re-save to apply and verify next run time in your timezone.