Skip to content

WP mu plugin which backs up specified options daily and provides a restore option via cli

Notifications You must be signed in to change notification settings

rickhurst/wp-option-backup-restore

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 

Repository files navigation

WP Options Backup Restore

Overview

WP Options Backup Restore is a WordPress plugin that provides automated daily backups for specified WordPress options and allows the restoration of options via the command-line interface (CLI).

Features

  • Scheduled Backups: Daily backups for specified WordPress options.
  • Backup Retention: Configurable number of backups to retain for each option.
  • CLI Support: Restore options using the WP-CLI command line.

Installation

  1. Download the plugin ZIP file.
  2. Upload and activate the plugin through the WordPress admin or using WP-CLI.

Configuration

Backup Options

By default, the plugin backs up the siteurl and sidebars_widgets options. You can modify the options to be backed up by updating the OBR_OPTIONS constant in the plugin file.

define( 'OBR_OPTIONS', ['siteurl', 'sidebars_widgets'] );

Backup Retention

Adjust the number of backups to retain for each option by modifying the OBR_BACKUP_LENGTH constant in the plugin file.

define( 'OBR_BACKUP_LENGTH', 3 );

WP-CLI Commands

List Backed-Up Options

List all backed-up options, including the backup count and time keys.

wp option-backup list

View Specific Backup

View a specific backup for a given option and time key.

wp option-backup view <option_name> [<time_key>] [--format=<format>]

Restore A Backup

Restore a specific backup for a given option and time key.

wp option-backup restore <option_name> [<time_key>] [--yes]

Backup Current Options Now

Manually trigger an immediate backup for all specified options.

wp option-backup now [--yes]

Credits

  • Author: Rick Hurst
  • License: GPL version 2 or later - GNU GPL 2.0

About

WP mu plugin which backs up specified options daily and provides a restore option via cli

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages