Backup Strategies
- Backup Strategies
This article details various backup strategies for your MediaWiki 1.40 installation. Protecting your wiki's data is crucial, and a well-defined backup plan can prevent significant data loss in the event of hardware failure, software corruption, or accidental deletion. This guide is geared toward system administrators and those responsible for maintaining the wiki server.
Understanding Backup Requirements
Before implementing a backup strategy, consider the following:
- Recovery Point Objective (RPO): How much data loss is acceptable? This dictates how frequently backups should be performed.
- Recovery Time Objective (RTO): How long can the wiki be down during a restore? This influences the complexity of the backup solution.
- Data Volume: The size of your wiki's data (database, images, files) impacts storage requirements and backup duration.
- Data Change Rate: How often is data modified? Frequently updated wikis require more frequent backups or incremental backup strategies.
Backup Components
A complete backup strategy encompasses several key components:
- Database Backup: The most critical component. This includes all wiki content, user data, and configuration settings. We'll focus on MySQL/MariaDB backups, as these are the most common database backends for MediaWiki.
- File Uploads Backup: Images and other files uploaded by users. These are typically stored in the `images` directory.
- Configuration Files Backup: `LocalSettings.php` and other configuration files are essential for restoring the wiki's functionality.
- Code Backup: Although less frequently changed, backing up the MediaWiki core files ensures a complete restore point.
Database Backup Strategies
The following table outlines common database backup methods:
Method | Description | Pros | Cons |
---|---|---|---|
mysqldump | A standard utility for creating logical backups of MySQL/MariaDB databases. | Simple, widely available, creates human-readable SQL files. | Can be slow for large databases, creates large backup files. |
mysqlbackup (MariaDB) | A physical backup tool specifically for MariaDB, offering faster backups and restores. | Faster than mysqldump, supports incremental backups. | Requires MariaDB, more complex to configure. |
XtraBackup (Percona) | Another physical backup tool, compatible with MySQL and MariaDB. | Fast, non-blocking backups, supports streaming. | Requires Percona installation, more complex to configure. |
Example `mysqldump` command:
```bash mysqldump -u [username] -p[password] [database_name] > wiki_backup.sql ```
Replace `[username]`, `[password]`, and `[database_name]` with your actual credentials and database name. Consider using a dedicated backup user with limited privileges. See Database Administration for more information.
File Uploads Backup
Backing up the `images` directory is essential. The following table shows different methods:
Method | Description | Pros | Cons |
---|---|---|---|
rsync | A versatile tool for synchronizing files and directories. | Efficient, supports incremental backups, preserves permissions. | Requires rsync to be installed on both source and destination. |
tar | A standard archiving utility. | Simple, widely available. | Can be slower than rsync for incremental backups. |
cp -R | A simple copy command. | Easiest to use for full backups. | Inefficient for incremental backups, can be slow for large directories. |
Example `rsync` command:
```bash rsync -avz /path/to/mediawiki/images/ /path/to/backup/images/ ```
Configuration and Code Backup
These files are less frequently modified but equally important. A simple `cp -R` or `tar` command can suffice.
File/Directory | Description | Backup Method |
---|---|---|
`LocalSettings.php` | The main MediaWiki configuration file. | `cp -R` or `tar` |
`extensions/` | Directory containing installed extensions. | `cp -R` or `tar` |
`skins/` | Directory containing installed skins. | `cp -R` or `tar` |
MediaWiki core files | The core MediaWiki code. | `tar` |
Example `tar` command:
```bash tar -czvf config_backup.tar.gz LocalSettings.php extensions/ skins/ ```
Backup Scheduling and Retention
Automate backups using tools like `cron` (Linux) or Task Scheduler (Windows). Implement a retention policy to manage backup storage. For example:
- Daily backups: Keep backups for the last 7 days.
- Weekly backups: Keep backups for the last 4 weeks.
- Monthly backups: Keep backups for the last 12 months.
Consider offsite storage for backups to protect against physical disasters. See Disaster Recovery for more details.
Testing Restores
Regularly test your backups by performing restores to a test environment. This verifies the integrity of your backups and ensures you can successfully recover your wiki in a disaster scenario. Refer to Restoring a Wiki for detailed instructions. Don't skip this step!
Related Pages
- Database Administration
- Restoring a Wiki
- Disaster Recovery
- Security Policy
- Server Maintenance
- Configuration
- Extensions
- Skins
- MediaWiki Installation
- Troubleshooting
- Performance Optimization
- Upgrading MediaWiki
- API Usage
- User Rights Management
- Customizing the Interface
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.* ⚠️