Data Backup and Recovery
- Data Backup and Recovery
This article details the procedures and configurations necessary for robust data backup and recovery for our MediaWiki 1.40 installation. Consistent and reliable backups are critical for mitigating data loss due to hardware failure, software errors, security breaches, or accidental modifications. This guide is designed for system administrators and those responsible for maintaining the integrity of our wiki.
Understanding Backup Strategies
There are several approaches to data backup. We employ a combination of full, incremental, and differential backups to balance speed, storage space, and recovery time.
- Full Backup: A complete copy of all data. Slowest to create but fastest to restore.
- Incremental Backup: Copies only the data that has changed since the *last* backup (full or incremental). Faster to create, slower to restore. Requires the full backup *and* all subsequent incremental backups for a full restore.
- Differential Backup: Copies only the data that has changed since the *last full* backup. Faster to create than full backups, and faster to restore than incremental, but grows larger with each backup until the next full backup.
Our current strategy utilizes a weekly full backup, followed by daily incremental backups. This ensures a relatively quick restore point while minimizing storage requirements.
Components to Back Up
A complete backup solution must include the following components:
- Wiki Database: Contains all wiki content, revisions, user data, and configuration. This is typically a MySQL or PostgreSQL database.
- Wiki Files: The `images/` directory, which stores uploaded files. This also includes any custom extensions or skins placed outside of the standard directory structure.
- Configuration Files: `LocalSettings.php` is critical, as it contains database credentials and other essential settings. Backing up the entire `/etc/mediawiki/` directory is recommended.
- Web Server Configuration: Backing up the Apache or Nginx configuration files allows for easy restoration of web server settings.
Backup Procedures
The following outlines the procedures used for each backup type. These are automated using Cron jobs.
Full Backup Procedure
1. Database Backup: Utilize `mysqldump` (for MySQL) or `pg_dump` (for PostgreSQL) to create a full database dump. 2. File System Backup: Use `tar` or `rsync` to archive the `images/` directory and `/etc/mediawiki/` directory. 3. Verification: Test the database dump by attempting a restore to a staging environment. (See Restoring Data section).
Incremental Backup Procedure
1. Database Backup: Use the database server's incremental backup features (if available) or rely on the change logs. Alternatively, a full database query for changes since the last backup can be used, though this is less efficient. 2. File System Backup: Use `rsync` with the `--link-dest` option to efficiently copy only changed files. This utilizes hard links to avoid duplicating unchanged files. 3. Verification: Periodically verify the integrity of incremental backups by attempting a partial restore.
Technical Specifications
The following table details the specifications of our backup system:
Component | Specification | Details |
---|---|---|
Database Server | MySQL 8.0 | Running on a dedicated server with RAID 1 mirroring. |
Backup Storage | Network Attached Storage (NAS) | 10TB capacity, RAID 6 configured for redundancy. |
Backup Software | Custom Scripts (Bash) | Utilizing `mysqldump`, `pg_dump`, `tar`, and `rsync`. |
Backup Retention | Weekly Full Backups (4 weeks) | Daily Incremental Backups (7 days) |
Encryption | AES-256 | All backups are encrypted at rest. |
Recovery Procedures
Restoring data requires careful planning and execution.
Database Restoration
1. Stop the Web Server: Prevent any further writes to the database. 2. Restore the Dump: Use `mysql` (for MySQL) or `psql` (for PostgreSQL) to restore the database dump. 3. Verify Restoration: Check the wiki to ensure data integrity and functionality.
File System Restoration
1. Stop the Web Server: Prevent any file modifications. 2. Restore Files: Extract the archived `images/` and `/etc/mediawiki/` directories to their original locations. 3. Verify Restoration: Ensure all uploaded files and configuration settings are correct.
Disaster Recovery Plan
In the event of a complete server failure, the following steps will be taken:
Step | Description | Estimated Time |
---|---|---|
1. Server Replacement | Provision a new server with identical specifications. | 2-8 hours |
2. OS Installation & Configuration | Install the operating system and necessary software (PHP, MySQL/PostgreSQL, Web Server). | 4-8 hours |
3. MediaWiki Installation | Install MediaWiki 1.40. | 1-2 hours |
4. Database Restoration | Restore the latest database dump. | 1-4 hours |
5. File System Restoration | Restore the latest file system archive. | 2-4 hours |
6. Configuration | Configure the web server and MediaWiki. | 1-2 hours |
7. Testing | Thoroughly test the wiki functionality. | 2-4 hours |
Monitoring and Testing
Regular monitoring and testing are essential to ensure the effectiveness of the backup and recovery system.
- Backup Verification: Automated scripts verify the integrity of backups after creation.
- Restore Tests: Quarterly restore tests are conducted to simulate a disaster recovery scenario.
- Log Monitoring: Backup logs are monitored for errors and warnings. See System Logs for details on log analysis.
- Storage Space Monitoring: Alerting is in place to notify administrators when backup storage is nearing capacity.
Related Pages
- System Administration
- Database Maintenance
- Server Security
- Cron Jobs
- MySQL
- PostgreSQL
- Apache
- Nginx
- Restoring Data
- LocalSettings.php
- System Logs
- Disaster Recovery
- File Management
- Extension Management
- Skin Management
Intel-Based Server Configurations
Configuration | Specifications | Benchmark |
---|---|---|
Core i7-6700K/7700 Server | 64 GB DDR4, NVMe SSD 2 x 512 GB | CPU Benchmark: 8046 |
Core i7-8700 Server | 64 GB DDR4, NVMe SSD 2x1 TB | CPU Benchmark: 13124 |
Core i9-9900K Server | 128 GB DDR4, NVMe SSD 2 x 1 TB | CPU Benchmark: 49969 |
Core i9-13900 Server (64GB) | 64 GB RAM, 2x2 TB NVMe SSD | |
Core i9-13900 Server (128GB) | 128 GB RAM, 2x2 TB NVMe SSD | |
Core i5-13500 Server (64GB) | 64 GB RAM, 2x500 GB NVMe SSD | |
Core i5-13500 Server (128GB) | 128 GB RAM, 2x500 GB NVMe SSD | |
Core i5-13500 Workstation | 64 GB DDR5 RAM, 2 NVMe SSD, NVIDIA RTX 4000 |
AMD-Based Server Configurations
Configuration | Specifications | Benchmark |
---|---|---|
Ryzen 5 3600 Server | 64 GB RAM, 2x480 GB NVMe | CPU Benchmark: 17849 |
Ryzen 7 7700 Server | 64 GB DDR5 RAM, 2x1 TB NVMe | CPU Benchmark: 35224 |
Ryzen 9 5950X Server | 128 GB RAM, 2x4 TB NVMe | CPU Benchmark: 46045 |
Ryzen 9 7950X Server | 128 GB DDR5 ECC, 2x2 TB NVMe | CPU Benchmark: 63561 |
EPYC 7502P Server (128GB/1TB) | 128 GB RAM, 1 TB NVMe | CPU Benchmark: 48021 |
EPYC 7502P Server (128GB/2TB) | 128 GB RAM, 2 TB NVMe | CPU Benchmark: 48021 |
EPYC 7502P Server (128GB/4TB) | 128 GB RAM, 2x2 TB NVMe | CPU Benchmark: 48021 |
EPYC 7502P Server (256GB/1TB) | 256 GB RAM, 1 TB NVMe | CPU Benchmark: 48021 |
EPYC 7502P Server (256GB/4TB) | 256 GB RAM, 2x2 TB NVMe | CPU Benchmark: 48021 |
EPYC 9454P Server | 256 GB RAM, 2x2 TB NVMe |
Order Your Dedicated Server
Configure and order your ideal server configuration
Need Assistance?
- Telegram: @powervps Servers at a discounted price
⚠️ *Note: All benchmark scores are approximate and may vary based on configuration. Server availability subject to stock.* ⚠️