### WP-CLI: Start Migration Source: https://safeguard.verdelic.com/docs/migration Initiate a migration on the source site using the migration code obtained from the destination site. This command starts the data transfer process. ```bash # Start a migration using the code from the destination wp safeguard migrate start ``` -------------------------------- ### Pagination Headers and Querying Source: https://safeguard.verdelic.com/docs/api-reference Examples of pagination metadata returned in headers and how to use query parameters for paginated requests. ```text X-WP-Total: 47 X-WP-TotalPages: 3 ``` ```bash curl -u "admin:XXXX XXXX XXXX XXXX XXXX XXXX" \ "https://example.com/wp-json/safeguard/v1/backups?per_page=10&page=2" ``` -------------------------------- ### Install and Activate SafeGuard Plugin via WP-CLI Source: https://safeguard.verdelic.com/docs/getting-started Install and activate the SafeGuard plugin using a single WP-CLI command. This is an alternative to the manual WordPress admin upload process. ```bash wp plugin install /path/to/safeguard.zip --activate ``` -------------------------------- ### CLI Example - Scheduled Selective Backup Source: https://safeguard.verdelic.com/docs/selective-backup Demonstrates how to create a scheduled selective backup using the WP-CLI. ```APIDOC ## CLI Example: Scheduled Selective Backup ### Command ```bash wp safeguard schedule create \ --type=selective \ --frequency=daily \ --storage=s3 \ --time=03:00 \ --retention=14 ``` ### Description This command creates a new scheduled backup job. The backup type is set to `selective`, meaning specific files and tables can be configured. It is scheduled to run daily at 03:00 AM, store backups in S3, and retain the last 14 backups. This is ideal for high-frequency database-only backups or specific file sets. ``` -------------------------------- ### Check SafeGuard Status with WP-CLI Source: https://safeguard.verdelic.com/docs/getting-started Verify required PHP extensions are installed using the WP-CLI command. This is useful for troubleshooting or initial setup checks. ```bash wp safeguard status ``` -------------------------------- ### Migration job response examples Source: https://safeguard.verdelic.com/docs/api-reference JSON responses for active migration jobs or when no job is currently running. ```json { "id": "mig_a1b2c3d4", "status": "running", "progress": 62, "source_url": "https://old-site.com", "created_at": "2026-03-20T10:00:00Z" } ``` ```json { "active": false } ``` -------------------------------- ### Backup completion response with chain_next Source: https://safeguard.verdelic.com/docs/api-reference Example of a backup response containing the chain_next field, which indicates an automatically triggered follow-up job. ```json { "id": "bkp_a1b2c3d4", "type": "full", "status": "completed", "size": 245000000, "duration": 44, "created_at": "2026-03-20T10:00:00Z", "completed_at": "2026-03-20T10:00:44Z", "chain_next": { "action": "staging_create", "job_id": "stg_x1y2z3w4" } } ``` -------------------------------- ### GET /wp-json/safeguard/v1/backups Source: https://safeguard.verdelic.com/docs/api-reference Retrieve a paginated list of all backups. ```APIDOC ## GET /wp-json/safeguard/v1/backups ### Description Retrieve a list of backups. Supports pagination and filtering. ### Method GET ### Endpoint /wp-json/safeguard/v1/backups ### Parameters #### Query Parameters - **per_page** (integer) - Optional - Number of items per page (max: 100, default: 20) - **page** (integer) - Optional - Page number (default: 1) - **type** (string) - Optional - Filter by backup type - **storage** (string) - Optional - Filter by provider slug ### Response #### Success Response (200) - **Array** (object) - List of backup objects #### Response Example [ { "id": "bkp_a1b2c3d4", "type": "full", "status": "completed", "size": 245000000, "storage": "s3", "label": "Pre-deploy backup", "components": ["files", "database"], "created_at": "2026-03-01T02:00:05Z", "completed_at": "2026-03-01T02:00:49Z", "duration": 44 } ] ``` -------------------------------- ### Create Selective Backup Source: https://safeguard.verdelic.com/docs/selective-backup Initiates a selective backup by specifying the files and database tables to include. The backup process starts asynchronously upon successful request. ```APIDOC ## POST /wp-json/safeguard/v1/backups ### Description Creates a selective backup by specifying the files and database tables to include. The backup process starts asynchronously upon successful request. ### Method POST ### Endpoint /wp-json/safeguard/v1/backups ### Parameters #### Request Body - **type** (string) - Yes - Must be `selective` - **storageDestinations** (array) - No - Storage provider slugs. Default: `["local"]` - **scope.files** (array) - Yes - Paths relative to `wp-content/` - **scope.tables** (array) - Yes - Database table names to include ### Request Example ```json { "type": "selective", "storageDestinations": ["local"], "scope": { "files": [ "plugins/woocommerce", "themes/flavor" ], "tables": [ "wp_posts", "wp_postmeta", "wp_options" ] } } ``` ### Response #### Success Response (202 Accepted) - **id** (string) - Unique identifier for the backup job. - **type** (string) - Type of the backup (e.g., `selective`). - **status** (string) - Current status of the backup job (e.g., `running`). - **storage** (string) - The storage provider used for the backup. - **created_at** (string) - Timestamp when the backup job was created. #### Response Example ```json { "id": "bkp_s1e2l3c4", "type": "selective", "status": "running", "storage": "local", "created_at": "2026-03-28T14:30:00Z" } ``` ``` -------------------------------- ### View and Export SafeGuard Diagnostics via WP-CLI Source: https://safeguard.verdelic.com/docs/support Use WP-CLI commands to view all SafeGuard diagnostics or export them to a file. Ensure WP-CLI is installed and configured for your WordPress site. ```bash # View full diagnostics wp safeguard info all # Export to a file wp safeguard info export > diagnostics.txt ``` -------------------------------- ### Webhook event payload examples Source: https://safeguard.verdelic.com/docs/api-reference JSON payloads sent via POST requests for backup completed and backup failed events. ```json { "event": "backup.completed", "timestamp": "2026-03-02T02:00:49Z", "site_url": "https://example.com", "data": { "id": "bkp_a1b2c3d4", "type": "full", "status": "completed", "size": 245000000, "storage": "s3", "duration": 44, "created_at": "2026-03-02T02:00:05Z", "completed_at": "2026-03-02T02:00:49Z" } } ``` ```json { "event": "backup.failed", "timestamp": "2026-03-02T02:01:30Z", "site_url": "https://example.com", "data": { "id": "bkp_q7r8s9t0", "type": "full", "status": "failed", "storage": "s3", "error": "Storage upload failed: connection timeout after 30 seconds.", "created_at": "2026-03-02T02:00:05Z", "failed_at": "2026-03-02T02:01:30Z" } } ``` -------------------------------- ### Manage Global Retention Settings (REST API) Source: https://safeguard.verdelic.com/docs/retention-policies Interact with SafeGuard's global retention settings using the REST API. Use GET to retrieve current settings and POST to update them. Ensure you include the correct X-WP-Nonce header for authentication. ```bash # Get current retention settings curl -X GET "https://example.com/wp-json/safeguard/v1/settings/retention" \ -H "X-WP-Nonce: " # Update retention settings curl -X POST "https://example.com/wp-json/safeguard/v1/settings/retention" \ -H "X-WP-Nonce: " \ -H "Content-Type: application/json" \ -d '{"keepCount": 30, "keepDays": 90, "keepMinimum": 3}' ``` -------------------------------- ### Configure PHP Settings for VPS Source: https://safeguard.verdelic.com/docs/hosting-compatibility Recommended PHP configuration values for optimal backup performance on VPS or dedicated server environments. ```ini memory_limit = 256M max_execution_time = 300 upload_max_filesize = 512M post_max_size = 512M ``` -------------------------------- ### Create a staging site Source: https://safeguard.verdelic.com/docs/api-reference Initializes the creation of a staging site with specified user roles. ```http POST /wp-json/safeguard/v1/staging/create ``` ```json { "mode": "quick", "staging_roles": { "3": "full", "7": "developer" } } ``` ```json { "id": "stg_x1y2z3w4", "mode": "quick", "status": "creating", "staging_roles": { "3": "full", "7": "developer" }, "created_at": "2026-03-20T10:00:00Z" } ``` -------------------------------- ### GET /wp-json/safeguard/v1/backups/{id} Source: https://safeguard.verdelic.com/docs/api-reference Retrieve detailed information for a specific backup. ```APIDOC ## GET /wp-json/safeguard/v1/backups/{id} ### Description Get full details for a specific backup by its ID. ### Method GET ### Endpoint /wp-json/safeguard/v1/backups/{id} ### Parameters #### Path Parameters - **id** (string) - Required - The unique identifier of the backup ### Response #### Success Response (200) - **id** (string) - Backup ID - **status** (string) - Status of the backup - **file_count** (integer) - Number of files included - **table_count** (integer) - Number of database tables included #### Response Example { "id": "bkp_a1b2c3d4", "type": "full", "status": "completed", "size": 245000000, "storage": "s3", "label": "Pre-deploy backup", "components": ["files", "database"], "file_count": 12847, "table_count": 42, "created_at": "2026-03-01T02:00:05Z", "completed_at": "2026-03-01T02:00:49Z", "duration": 44 } ``` -------------------------------- ### Run Full Restore Source: https://safeguard.verdelic.com/docs/restore Execute a full website restore using the provided restore ID. The --yes flag bypasses the confirmation prompt. ```bash # Run preflight checks first wp safeguard restore preflight 42 # Start a full restore (--yes skips the confirmation prompt) wp safeguard restore run 42 --yes ``` -------------------------------- ### GET /wp-json/safeguard/v1/settings/notifications Source: https://safeguard.verdelic.com/docs/email-notifications Retrieves the current email notification configuration settings. ```APIDOC ## GET /wp-json/safeguard/v1/settings/notifications ### Description Read the current notification settings. ### Method GET ### Endpoint https://example.com/wp-json/safeguard/v1/settings/notifications ### Request Example curl -X GET "https://example.com/wp-json/safeguard/v1/settings/notifications" \ -H "X-WP-Nonce: " ``` -------------------------------- ### Run Full Backup with WP-CLI Source: https://safeguard.verdelic.com/docs/backup-types Use this command to initiate a full backup of your WordPress site via WP-CLI. This is recommended for the initial backup or before major updates. ```bash wp safeguard backup run --type=full ``` -------------------------------- ### Get Backup Details Endpoint Source: https://safeguard.verdelic.com/docs/api-reference Retrieve detailed information for a specific backup by its ID. ```http GET /wp-json/safeguard/v1/backups/{id} ``` ```json { "id": "bkp_a1b2c3d4", "type": "full", "status": "completed", "size": 245000000, "storage": "s3", "label": "Pre-deploy backup", "components": ["files", "database"], "file_count": 12847, "table_count": 42, "created_at": "2026-03-01T02:00:05Z", "completed_at": "2026-03-01T02:00:49Z", "duration": 44, "parent_id": null } ``` -------------------------------- ### Preview Restore with Dry Run Source: https://safeguard.verdelic.com/docs/restore Simulate a restore operation to preview which files would be restored and pruned without making any actual changes to the site. ```bash wp safeguard restore run 42 --dry-run ``` -------------------------------- ### Get active staging job Source: https://safeguard.verdelic.com/docs/api-reference Retrieves the status of the currently active staging job. ```http GET /wp-json/safeguard/v1/staging/active-job ``` ```json { "id": "stg_x1y2z3w4", "mode": "quick", "status": "creating", "progress": 45, "created_at": "2026-03-20T10:00:00Z" } ``` ```json { "active": false } ``` -------------------------------- ### GET /wp-json/safeguard/v1/migrate/active-job Source: https://safeguard.verdelic.com/docs/api-reference Retrieves the currently active migration job to allow for reconnection after page refreshes. ```APIDOC ## GET /wp-json/safeguard/v1/migrate/active-job ### Description Returns the currently active migration job, if any. This is useful for reconnecting to an in-progress migration after a page refresh. ### Method GET ### Endpoint /wp-json/safeguard/v1/migrate/active-job ### Response #### Success Response (200) - **id** (string) - The migration job ID - **status** (string) - The current status of the job - **progress** (integer) - Percentage of completion - **source_url** (string) - The source URL of the migration - **created_at** (string) - ISO 8601 timestamp of creation #### Response Example { "id": "mig_a1b2c3d4", "status": "running", "progress": 62, "source_url": "https://old-site.com", "created_at": "2026-03-20T10:00:00Z" } ``` -------------------------------- ### Create a schedule Source: https://safeguard.verdelic.com/docs/api-reference Creates a new automated backup schedule. ```http POST /wp-json/safeguard/v1/schedules ``` ```json { "type": "incremental", "frequency": "daily", "storage": "s3", "time": "02:00", "retention": 30 } ``` ```json { "id": 3, "type": "incremental", "frequency": "daily", "storage": "s3", "time": "02:00", "retention": 30, "next_run": "2026-03-03T02:00:00Z", "enabled": true } ``` -------------------------------- ### Webhook security signature header Source: https://safeguard.verdelic.com/docs/api-reference Example of the X-SafeGuard-Signature header used to verify the authenticity of webhook requests. ```http X-SafeGuard-Signature: sha256=a1b2c3d4e5f6... ``` -------------------------------- ### Create a Backup Endpoint Source: https://safeguard.verdelic.com/docs/api-reference Initiate a new backup process. Returns a 202 Accepted status. ```http POST /wp-json/safeguard/v1/backups ``` ```json { "type": "full", "storage": "s3", "label": "Pre-deploy backup" } ``` ```json { "id": "bkp_m3n4o5p6", "type": "full", "status": "running", "storage": "s3", "label": "Pre-deploy backup", "created_at": "2026-03-02T14:30:00Z" } ``` -------------------------------- ### Retrieve Recommended Backup Schedules via WP-CLI Source: https://safeguard.verdelic.com/docs/scheduling Use these commands to fetch suggested backup schedules based on the site's detected profile. ```bash wp safeguard schedule recommend ``` ```bash wp safeguard schedule recommend --format=json ``` -------------------------------- ### Run Database-Only Backup via WP-CLI Source: https://safeguard.verdelic.com/docs/backup-types Executes a backup of all WordPress database tables without including filesystem data. ```bash wp safeguard backup run --type=database ``` -------------------------------- ### Get active migration job endpoint Source: https://safeguard.verdelic.com/docs/api-reference Retrieves the currently active migration job to allow for reconnection after page refreshes. ```http GET /wp-json/safeguard/v1/migrate/active-job ``` -------------------------------- ### Run Files-Only Backup via WP-CLI Source: https://safeguard.verdelic.com/docs/backup-types Captures the entire WordPress filesystem, including themes, plugins, and uploads, excluding the database. ```bash wp safeguard backup run --type=files ``` -------------------------------- ### Perform Large Database Migration via WP-CLI Source: https://safeguard.verdelic.com/docs/woocommerce Use these commands to initiate a migration for large databases, bypassing web server timeouts. ```bash # On the destination wp safeguard migrate receive # On the source wp safeguard migrate start ``` -------------------------------- ### POST /wp-json/safeguard/v1/backups Source: https://safeguard.verdelic.com/docs/api-reference Initiate a new backup process. ```APIDOC ## POST /wp-json/safeguard/v1/backups ### Description Create a new backup based on the provided configuration. ### Method POST ### Endpoint /wp-json/safeguard/v1/backups ### Parameters #### Request Body - **type** (string) - Optional - 'full', 'files', 'database', or 'incremental'. Default: 'full' - **storage** (string) - Optional - Storage provider slug. Default: primary provider - **label** (string) - Optional - Human-readable label ### Request Example { "type": "full", "storage": "s3", "label": "Pre-deploy backup" } ### Response #### Success Response (202) - **id** (string) - Backup ID - **status** (string) - Current status (e.g., 'running') #### Response Example { "id": "bkp_m3n4o5p6", "type": "full", "status": "running", "storage": "s3", "label": "Pre-deploy backup", "created_at": "2026-03-02T14:30:00Z" } ``` -------------------------------- ### Read Notification Settings via REST API Source: https://safeguard.verdelic.com/docs/email-notifications Use this GET request to retrieve the current email notification settings. Ensure you include the necessary nonce for authentication. ```bash curl -X GET "https://example.com/wp-json/safeguard/v1/settings/notifications" \ -H "X-WP-Nonce: " ``` -------------------------------- ### Activate SafeGuard License with WP-CLI Source: https://safeguard.verdelic.com/docs/getting-started Activate your SafeGuard license from the command line using WP-CLI. Replace the placeholder key with your actual license key. ```bash wp safeguard license activate SG-XXXX-XXXX-XXXX-XXXX ``` -------------------------------- ### View and Set Global Retention Settings (WP-CLI) Source: https://safeguard.verdelic.com/docs/retention-policies Use these WP-CLI commands to view current global retention settings and modify them. You can set the backup limit, enable delete-by-age mode, and configure the deletion of local copies after upload. ```bash # View current retention settings wp safeguard settings get retention # Set backup limit to 30 wp safeguard settings set retention.limit 30 # Enable delete-by-age mode wp safeguard settings set retention.deleteByAge true # Enable auto-delete of local copies after upload wp safeguard settings set retention.deleteLocalAfterUpload true ``` -------------------------------- ### Manage SafeGuard Schedules via WP-CLI Source: https://safeguard.verdelic.com/docs/scheduling Use these commands to create, list, update, run, and delete backup schedules directly from the command line. ```bash wp safeguard schedule create \ --name="Nightly Full Backup" \ --frequency=daily \ --type=full \ --time=02:00 \ --storage=my-s3-bucket ``` ```bash wp safeguard schedule list ``` ```bash wp safeguard schedule upcoming ``` ```bash wp safeguard schedule update --time=03:00 --enabled=true ``` ```bash wp safeguard schedule run ``` ```bash wp safeguard schedule delete --yes ``` -------------------------------- ### Create Selective Backup via CLI Source: https://safeguard.verdelic.com/docs/selective-backup Use the `wp safeguard backup create` command with `--type=selective` to back up specific files and/or database tables. Specify file paths relative to `wp-content/` and a comma-separated list of table names. ```bash wp safeguard backup create --type=selective \ --files=plugins/woocommerce,themes/flavor \ --tables=wp_wc_orders,wp_wc_order_items,wp_wc_order_stats \ --storage=s3 ``` ```bash wp safeguard backup create --type=selective \ --files=plugins/woocommerce,themes/flavor \ --tables=wp_posts,wp_postmeta,wp_options ``` ```bash wp safeguard backup create --type=selective \ --tables=wp_posts,wp_postmeta,wp_options,wp_usermeta \ --name="Pre-deploy DB snapshot" ``` -------------------------------- ### List and Monitor Schedules via WP-CLI Source: https://safeguard.verdelic.com/docs/scheduling Commands to view current backup schedules and upcoming execution timelines. ```bash # List all schedules with status wp safeguard schedule list # View upcoming runs wp safeguard schedule upcoming --limit=20 ``` -------------------------------- ### Perform Selective Restore Source: https://safeguard.verdelic.com/docs/restore Restore specific components of the website. Use --scope=database to restore only the database, or --scope=files to restore only themes, plugins, and uploads. ```bash # Restore only the database wp safeguard restore run 42 --scope=database --yes # Restore only files (themes, plugins, uploads) wp safeguard restore run 42 --scope=files --yes ``` -------------------------------- ### View Full Diagnostics with WP-CLI Source: https://safeguard.verdelic.com/docs/troubleshooting Use this command to display all diagnostic information directly in your terminal for quick review. ```bash wp safeguard info all ``` -------------------------------- ### Run Selective Backup via WP-CLI Source: https://safeguard.verdelic.com/docs/backup-types Performs a targeted backup of specific filesystem paths and database tables. ```bash # Back up specific paths and tables wp safeguard backup run --type=selective \ --include-paths="wp-content/plugins/woocommerce,wp-content/themes/storefront" \ --include-tables="wp_wc_orders,wp_wc_order_items" ``` -------------------------------- ### Test S3 Connection via WP-CLI Source: https://safeguard.verdelic.com/docs/storage-providers Use this command to test your S3-compatible storage connection from the command line. Ensure your WP-CLI is configured correctly. ```bash wp safeguard storage test s3 ``` -------------------------------- ### WP-CLI: Receive Migration Code Source: https://safeguard.verdelic.com/docs/migration Generate a migration code on the destination site using WP-CLI. This code is then used on the source site to initiate the migration. ```bash # Generate a migration code on the destination site wp safeguard migrate receive ``` -------------------------------- ### List schedules Source: https://safeguard.verdelic.com/docs/api-reference Retrieves all configured backup schedules. ```http GET /wp-json/safeguard/v1/schedules ``` ```json [ { "id": 1, "type": "incremental", "frequency": "daily", "storage": "s3", "time": "02:00", "retention": 30, "next_run": "2026-03-03T02:00:00Z", "last_run": "2026-03-02T02:00:05Z", "enabled": true } ] ``` -------------------------------- ### Run Incremental Backup with WP-CLI Source: https://safeguard.verdelic.com/docs/backup-types Execute an incremental backup using WP-CLI. This command backs up only changed files since the last full backup, making it faster and smaller. ```bash wp safeguard backup run --type=incremental ``` -------------------------------- ### Staging Site URL Formats Source: https://safeguard.verdelic.com/docs/staging Displays the supported URL structures for staging sites based on the selected access configuration. ```text https://example.com/staging/ # subdirectory https://staging.example.com/ # subdomain https://example.com/your-custom-path/ # custom path ``` -------------------------------- ### Manage Per-Schedule Retention (WP-CLI) Source: https://safeguard.verdelic.com/docs/retention-policies These WP-CLI commands allow you to list schedules and update their retention policies. You can configure schedules to keep a specific number of backups or retain them for a set number of days. ```bash # List all schedules to find the schedule ID wp safeguard schedule list # Update retention for a specific schedule (keep 14 backups) wp safeguard schedule update --retention='{"type":"count","value":14}' # Update retention to keep backups for 90 days wp safeguard schedule update --retention='{"type":"days","value":90}' ``` -------------------------------- ### Create a Scheduled Selective Backup via CLI Source: https://safeguard.verdelic.com/docs/selective-backup Configures a recurring selective backup using the WP-CLI command interface. ```bash wp safeguard schedule create \ --type=selective \ --frequency=daily \ --storage=s3 \ --time=03:00 \ --retention=14 ``` -------------------------------- ### Perform Emergency Restore (No License) Source: https://safeguard.verdelic.com/docs/restore Bypass the license check during a restore operation when the license server is unreachable. This is intended for emergency situations. ```bash wp safeguard restore run 42 --force --yes ``` -------------------------------- ### Enable Backup Encryption via REST API Source: https://safeguard.verdelic.com/docs/security Use this REST API endpoint to enable or disable backup encryption. Ensure you have the correct nonce for authentication. ```bash curl -X POST /wp-json/safeguard/v1/storage/settings \ -H "X-WP-Nonce: " \ -d '{"encryptBackups": true}' ``` -------------------------------- ### Create a Selective Backup via REST API Source: https://safeguard.verdelic.com/docs/selective-backup Initiates a selective backup by sending a POST request with the required scope of files and tables. ```http POST /wp-json/safeguard/v1/backups ``` ```json { "type": "selective", "storageDestinations": ["local"], "scope": { "files": [ "plugins/woocommerce", "themes/flavor" ], "tables": [ "wp_posts", "wp_postmeta", "wp_options" ] } } ``` -------------------------------- ### Manage Quarantined Files via WP-CLI Source: https://safeguard.verdelic.com/docs/security Commands for listing, restoring, or cleaning up files moved to the quarantine directory. ```bash # List quarantined files wp safeguard quarantine list # Restore a quarantined file wp safeguard quarantine restore # Delete all quarantined files wp safeguard quarantine clean ``` -------------------------------- ### List storage providers Source: https://safeguard.verdelic.com/docs/api-reference Retrieves a list of all configured storage providers and their current status. ```http GET /wp-json/safeguard/v1/storage-providers ``` ```json [ { "slug": "s3", "provider": "Amazon S3", "bucket": "my-backups", "region": "us-east-1", "path": "safeguard/", "is_primary": true, "last_tested": "2026-03-01T12:00:00Z", "test_status": "passed" }, { "slug": "dropbox", "provider": "Dropbox", "path": "/Apps/SafeGuard", "is_primary": false, "last_tested": "2026-02-28T09:15:00Z", "test_status": "passed" } ] ```