安装备份插件:在WordPress后台搜索并安装任何备份插件,如UpdraftPlus、BackupBuddy、VaultPress等。
配置备份插件:根据插件的不同,它们的配置方式也会有所不同。一般情况下,您需要指定备份的频率、数据存放的位置,以及需要备份的数据类型和大小等。
以下是UpdraftPlus备份插件的示例代码:
/* UpdraftPlus Backup Plugin Settings */
define('UPDRAFTPLUS_SKIP_FILES', 'tar,gz,bz2,zip,bak,sql');
define('UPDRAFTPLUS_SKIP_WORDS', 'tmp,temp,cache,backup,cache,wp-content/cache,wp-snapshots,.git,.svn');
define('UPDRAFTPLUS_SKIP_EXTRA', true);
define('UPDRAFTPLUS_NO_MULTISITE_SUPPORT', false);
define('UPDRAFTPLUS_ALLOW_EXPERIMENTAL', false);
define('UPDRAFTPLUS_IS_WP_CLI', false);
define('UPDRAFTPLUS_SMTP_USE_NATIVE_FUNCTION', false);
define('UPDRAFTPLUS_SMTP_PORT', '');
define('UPDRAFTPLUS_RECENTFILES', 5);
define('UPDRAFTPLUS_NO_EMAIL', true);
define('UPDRAFTPLUS_ONLYADMIN', true);
define('UPDRAFTPLUS_WARNONIMPORT', true);
define('UPDRAFTPLUS_DISABLE_REMOTE_GET', true);
define('UPDRAFTPLUS_DISABLE_REMOTE_GET_SERVER', true);
define('UPDRAFTPLUS_MAX_FILES_IN_ARCHIVE', 5000);
define('UPDRAFTPLUS_CRYPT_KEY', '');
define('UPDRAFTPLUS_CRYPT_CIPHER', 'aes-256-cbc');
define('UPDRAFTPLUS_IMPORTMETHOD', 'zip');
define('UPDRAFTPLUS_NO_DB_BACKUP', false);
define('UPDRAFTPLUS_SHUTDOWN_BACKUP_SCRIPT', false);
define('UPDRAFTPLUS_NO_ASK_BEFORE_RESTORE', false);
define('UPDRAFTPLUS_FORCE_ZIP_LIBRARY', false);
define('UPDRAFTPLUS_EXCLUDEDDIRECTORIES', '');
define('UPDRAFTPLUS_ALLOWEXCLUDEDIRECTORIESGLOB', false);
define('UPDRAFTPLUS_IS_TEMP_BACKUP', isset($_GET['_updraftplus_is_temp_backup']) && $_GET['_updraftplus_is_temp_backup'] == 'yes' ? true : false);
define('UPDRAFTPLUS_RESTORETABLEPREFIX', '');
define('UPDRAFTPLUS_AUTOMATED_BACKUP_SCHEDULE', '');
define('UPDRAFTPLUS_AUTOMATED_BACKUP_SCHEDULE_INTERVAL', '');
define('UPDRAFTPLUS_AUTOMATED_BACKUP_SCHEDULE_LAST_SAVED', '');
define('UPDRAFTPLUS_DISABLE_AUTOMATED_BACKUPS', '');
define('UPDRAFTPLUS_TWITTER_CONSUMER_KEY', '');
define('UPDRAFTPLUS_TWITTER_CONSUMER_SECRET', '');
define('UPDRAFTPLUS_TWITTER_ACCESS_TOKEN', '');
define('UPDRAFTPLUS_TWITTER_ACCESS_SECRET', '');
define('UPDRAFTPLUS_DBTOMIGRATETOS3', '');
define('UPDRAFTPLUS_DBTOMIGRATE', '');
define('UPDRAFTPLUS_GDRIVE_HIDE_LEAVE_A_COPY', '');
define('UPDRAFTPLUS_GDRIVE_LEAVEDOC', '');
define('UPDRAFTPLUS_GDRIVE_LEAVEFOLDER', '');
define('UPDRAFTPLUS_GDRIVE_LEAVEFLD_ON_BACKUPS_DELETE', '');
define('UPDRAFTPLUS_HAS_REAL_WP_VERSION_DATA', '');
define('UPDRAFTPLUS_NONCEFILE', '');
define('UPDRAFTPLUS_STORAGE_QUOTA_OVERRIDE', '');
define('UPDRAFTPLUS_DISABLE_CRON', '');
define('UPDRAFTPLUS_DISABLE_UPLOADS_BACKUP', '');
define('UPDRAFTPLUS_GDRIVE_REDIRECT_LOOP_PREVENTION', '');
define('UPDRAFTPLUS_ADMIN_ONLY_BACKUP_FEEDBACK', '');
define('UPDRAFTPLUS_BY_PASS_HHVM', '');
define('UPDRAFTPLUS_DISABLE_RESCUE_WEB_UI', '');
define('UPDRAFTPLUS_DISABLE_UPDATE_WEB_UI', '');
define('UPDRAFTPLUS_DISABLE_RESUME_UPLOAD', '');
define('UPDRAFTPLUS_REPORT_PHP_VERSION', '');
define('UPDRAFTPLUS_RECIPROCAL_RESTORE_LICENSE', '');
define('UPDRAFTPLUS_EMAILLOG_HANDLER', '');
define('UPDRAFTPLUS_DELETEDB_HANDLER', '');
define('UPDRAFTPLUS_RESTORE_BEFORE_REPLACE_HANDLER', '');
define('UPDRAFTPLUS_REMEMBER_SETTINGS', '');
define('UPDRAFTPLUS_MIGRATE_ID_SEQ', '');
define('UPDRAFTPLUS_OMITTABLENAMES', '');
define('UPDRAFTPLUS_DOCUMENTROOT', '');
define('UPDRAFTPLUS_WRITEACCESSCHECK', '');
define('UPDRAFTPLUS_KEEP_DELETE_HISTORY', '');
define('UPDRAFTPLUS_DISABLE_REPEAT_REPORTING', '');
define('UPDRAFTPLUS_DEBUG_MODE', '');
define('UPDRAFTPLUS_CRYPT_SIPKEY', '');
define('UPDRAFTPLUS_BACKUP_ONLY_ONCE_PER_DAY', '');
define('UPDRAFTPLUS_DO_BACKUP_WITHOUT_REPORT_UI', '');
define('UPDRAFTPLUS_OFFLINE', '');
define('UPDRAFTPLUS_WP_CLI_PHAR', '');
define('UPDRAFTPLUS_DO_REPORTING_TO_RC2_COMPANION', '');
define('UPDRAFTPLUS_USE_LEGACY_TOOLS', '');
define('UPDRAFTPLUS_SKIPBACKUPS_WEEKDAYS_AFTER_THIS_HOUR', '');
define('UPDRAFTPLUS_SKIPBACKUPS_WEEKDAYS_BEFORE_THIS_HOUR', '');
define('UPDRAFTPLUS_GDRIVE_APIKEY', '');
define('UPDRAFTPLUS_HIDE_EMAIL_ADDRESS_PROMPT', '');
define('UPDRAFTPLUS_HIDE_HTTP_CONFIRM', '');
define('UPDRAFTPLUS_DISABLE_TELEMETRY', '');
define('UPDRAFTPLUS_SKIPBACKUPS_WEEKENDS_AFTER_THIS_HOUR', '');
define('UPDRAFTPLUS_SKIPBACKUPS_WEEKENDS_BEFORE_THIS_HOUR', '');
define('UPDRAFTPLUS_CRYPT_IV', '');
define('UPDRAFTPLUS_USE_ADMIN_BAR', '');
define('UPDRAFTPLUS_PREVENT_REPLACE_RESTORE', '');
define('UPDRAFTPLUS_EMAIL_FROM_ADDRESS', '');
define('UPDRAFTPLUS_EMAIL_FROM_NAME', '');
define('UPDRAFTPLUS_SMTP_HOSTNAME', '');
define('UPDRAFTPLUS_SMTP_AUTH_USER', '');
define('UPDRAFTPLUS_SMTP_AUTH_PASS', '');
define('UPDRAFTPLUS_SMTP_SECURE', '');
define('UPDRAFTPLUS_SMTP_TIMEOUT', '');
define('UPDRAFTPLUS_SMTP_DEBUG', '');
define('UPDRAFTPLUS_SPREADSHEET_APPEND_ROWS', '');
define('UPDRAFTPLUS_MODIFY_CONFIG', '');
define('UPDRAFTPLUS_DISABLE_REPORT_UI', '');