SafeGuard

Selective Backup

Back up only the files and database tables you choose with SafeGuard's selective backup feature.

What Is Selective Backup

A selective backup lets you choose exactly which files and database tables to include instead of backing up your entire site. You pick specific plugins, themes, uploads, other wp-content files, and individual database tables from an interactive tree browser. SafeGuard then creates a backup containing only the items you selected.

Selective backups are available in SafeGuard v1.1.0 and later.


When to Use Selective Backup

ScenarioWhat to select
Before a plugin updateThe plugin folder + its database tables
Database-only snapshotOnly the tables you need (e.g., wp_posts, wp_postmeta)
Backing up a specific themeThe theme directory under Themes
Large media librariesSkip uploads to save time and storage
Isolating WooCommerce dataWooCommerce plugin folder + wp_wc_* tables
Quick config backupJust wp_options and a few key tables

For routine daily backups, use full or incremental backups. Selective backups are best for targeted snapshots before risky changes.


Using the File Tree Browser

The file tree browser shows your wp-content directory organized into four categories:

CategoryContents
PluginsAll installed plugins, each as a selectable folder
ThemesAll installed themes
UploadsMedia library organized by year/month
Other wp-content filesEverything else in wp-content (e.g., mu-plugins, languages, custom directories)

How the tree works

  • Expand directories by clicking the arrow icon. Child contents are loaded on demand, so the initial scan is fast even on large sites.
  • Select items using the checkboxes. Selecting a parent directory automatically selects all its children.
  • Estimated sizes appear next to each item so you can gauge the backup size before starting.
  • "Other wp-content files" loads in pages of 20 items. Click Load more to see additional files if your wp-content directory has extra folders or loose files.
  • Refresh data using the refresh button at the top to re-scan the filesystem. Scan results are cached for one hour.

Selecting Database Tables

The database panel lists every table in your WordPress database with its size. Tables are grouped under a root Database node.

  • Each table shows its name and size (e.g., wp_posts — 12.4 MB).
  • Select individual tables or check the root node to select all tables.
  • Core WordPress tables, plugin tables, and custom tables all appear in the list.

Be careful when selecting database tables individually. Some plugins store data across multiple related tables. If you only back up some of them, restoring later could leave the plugin in an inconsistent state.


Creating a Selective Backup

Open the Backup page

Navigate to SafeGuard → Backup in the WordPress admin. Click Selective Backup to expand the selective backup section.

Select files

In the left panel, expand the file tree categories (Plugins, Themes, Uploads, Other) and check the items you want to include. The summary bar at the bottom updates with the selected file count and estimated size.

Select database tables

In the right panel, check the database tables you want to include. You can select all tables or pick individual ones.

Review and start

The summary bar shows the combined estimated backup size, the number of selected folders/files, and the number of selected tables. Click Start Selective Backup to begin.

Monitor progress

The backup runs in the background. You can close your browser and return later — SafeGuard picks up where it left off. The backup appears in your backup list with type selective once complete.

Create a selective backup from the command line by specifying --type=selective along with --files and/or --tables:

wp safeguard backup create --type=selective \
  --files=plugins/woocommerce,themes/flavor \
  --tables=wp_posts,wp_postmeta,wp_options

Options:

OptionDescription
--type=selectiveRequired. Sets the backup type to selective.
--files=<paths>Comma-separated list of paths relative to wp-content/.
--tables=<tables>Comma-separated list of database table names.
--storage=<provider>Storage provider slug. Default: primary provider.
--name=<name>Human-readable label for the backup.

Example — back up only the database:

wp safeguard backup create --type=selective \
  --tables=wp_posts,wp_postmeta,wp_options,wp_usermeta \
  --name="Pre-deploy DB snapshot"

Example — back up a single plugin and its tables:

wp safeguard backup create --type=selective \
  --files=plugins/woocommerce \
  --tables=wp_wc_orders,wp_wc_order_items,wp_wc_order_stats \
  --storage=s3

Selective Backup via REST API

Create a selective backup by sending a POST request with type set to selective and a scope object containing the selected file paths and table names.

POST /wp-json/safeguard/v1/backups

Request body:

{
  "type": "selective",
  "storageDestinations": ["local"],
  "scope": {
    "files": [
      "plugins/woocommerce",
      "themes/flavor"
    ],
    "tables": [
      "wp_posts",
      "wp_postmeta",
      "wp_options"
    ]
  }
}
FieldTypeRequiredDescription
typestringYesMust be selective
storageDestinationsarrayNoStorage provider slugs. Default: ["local"]
scope.filesarrayYesPaths relative to wp-content/
scope.tablesarrayYesDatabase table names to include

Response (202 Accepted):

{
  "id": "bkp_s1e2l3c4",
  "type": "selective",
  "status": "running",
  "storage": "local",
  "created_at": "2026-03-28T14:30:00Z"
}

Selective Scanner Endpoints

These endpoints power the interactive tree browser and are useful if you are building custom integrations.

EndpointMethodDescription
/backups/selective/filesGETReturns the file tree. Params: depth (1-10, default 2), refresh (boolean).
/backups/selective/files/expandGETExpands a directory node. Params: path (required), depth (1-5, default 1).
/backups/selective/files/otherGETPaginated list of "Other wp-content files". Params: offset, limit (max 100).
/backups/selective/tablesGETReturns the database table tree. Params: refresh (boolean).
/backups/selective/cacheDELETEClears the scanner cache.

Restoring from Selective Backups

A selective backup is a partial backup — it only contains the files and tables you selected. Keep these points in mind when restoring:

  • Selective backups do not replace everything. Only the files and tables included in the backup are restored. Everything else on the site remains untouched.
  • Restoring a selective backup will overwrite the specific files and tables it contains with the versions from the backup.
  • You cannot restore files that were not included. If you need a complete site restore, use a full backup.
  • Selective restore is available from the Restore page. SafeGuard detects that the backup is selective and shows you exactly what it contains so you can confirm before proceeding.

If you are restoring database tables from a selective backup, make sure you included all related tables when the backup was created. Restoring a partial set of tables for a plugin can cause data integrity issues.


Combining with Schedules

You can use selective backups in scheduled jobs. When creating or editing a schedule, choose Selective as the backup type. The schedule configuration shows the same file tree browser and table selector, letting you define exactly what the recurring backup includes.

Create a new schedule

Go to SafeGuard → Schedules and click Add Schedule.

Choose "Selective" as the backup type

Select Selective from the backup type dropdown. The file and table selectors appear below.

Configure scope, frequency, and retention

Pick the files and tables to include, set the schedule frequency (hourly, daily, weekly, or monthly), choose a storage provider, and set a retention count.

CLI example — scheduled selective backup:

wp safeguard schedule create \
  --type=selective \
  --frequency=daily \
  --storage=s3 \
  --time=03:00 \
  --retention=14

Selective schedules are ideal for high-frequency database-only backups (e.g., hourly snapshots of wp_posts and wp_options) while running a separate full backup on a weekly schedule.


Best Practices

Use selective backup when:

  • You are about to update a specific plugin or theme and want a rollback point for just that component.
  • You need a quick database snapshot without waiting for a full file scan.
  • Your site has a very large uploads directory and you only need to back up recent changes.
  • You manage client sites and want to back up only the custom work (theme + key plugin tables).

Prefer full backups when:

  • You need a complete disaster-recovery archive.
  • You are setting up automated daily/weekly backups for general protection.
  • You are migrating to a new host (migration requires a full backup).

A selective backup is not a substitute for full backups. Always maintain a regular full backup schedule alongside any selective backups. Selective backups are a complement, not a replacement.

Tips:

  • Check estimated sizes before starting. The summary bar shows the combined size so you can estimate storage usage and transfer time.
  • Use the refresh button if you recently installed a plugin or uploaded files — the scanner cache is valid for one hour.
  • Name your selective backups with a descriptive label (e.g., "Pre-WooCommerce-update") so you can easily find them later in the backup list.
  • Include related tables together. If backing up a plugin, include all of its database tables to avoid inconsistencies on restore.

On this page