Backup Strategies
Learn how to backup and restore your Minecraft server data.
Regular backups are essential for protecting your server data. This guide covers backup strategies, automation, and recovery procedures.
What to Backup
A complete backup should include:
| Directory | Contents | Priority |
|---|---|---|
| world/ | Main world data, player data | Critical |
| world_nether/ | Nether dimension | Critical |
| world_the_end/ | End dimension | Critical |
| plugins/ | Plugin JARs and configurations | High |
| server.properties | Server configuration | High |
| *.json | Bans, whitelist, operators | Medium |
| logs/ | Server logs | Low |
Backup Methods
Manual Backup
For quick one-time backups:
- Run
save-allin the console to flush changes to disk - Run
save-offto pause auto-saving - Create your backup (copy/compress files)
- Run
save-onto resume auto-saving
# Create compressed backup
cd /path/to/server
tar -czf backup-$(date +%Y%m%d-%H%M%S).tar.gz \
world world_nether world_the_end \
plugins server.properties *.jsonAutomated Backups
Set up scheduled backups with cron (Linux):
# Backup every 6 hours
0 */6 * * * /path/to/backup-script.sh
# Daily backup at 4 AM
0 4 * * * /path/to/backup-script.sh
# Weekly full backup on Sunday at 3 AM
0 3 * * 0 /path/to/full-backup-script.shBackup Script Example
#!/bin/bash
SERVER_DIR="/opt/minecraft/server"
BACKUP_DIR="/opt/minecraft/backups"
DATE=$(date +%Y%m%d-%H%M%S)
RETAIN_DAYS=7
# Create backup directory
mkdir -p $BACKUP_DIR
# Save and pause
screen -S minecraft -X stuff "save-all\n"
sleep 5
screen -S minecraft -X stuff "save-off\n"
sleep 2
# Create backup
tar -czf $BACKUP_DIR/backup-$DATE.tar.gz \
-C $SERVER_DIR \
world world_nether world_the_end \
plugins server.properties *.json
# Resume saving
screen -S minecraft -X stuff "save-on\n"
# Delete old backups
find $BACKUP_DIR -name "backup-*.tar.gz" -mtime +$RETAIN_DAYS -delete
echo "Backup completed: backup-$DATE.tar.gz"Backup Storage
Local Storage
- Fast backup and restore
- No network dependency
- Risk: Same server failure affects backups
Remote Storage
For better protection, sync backups to remote storage:
Cloud Storage
AWS S3, Google Cloud, Backblaze B2
Remote Server
rsync to a separate backup server
NAS/Network Drive
Local network storage solution
# rsync to backup server
rsync -avz --delete $BACKUP_DIR/ user@backup-server:/backups/minecraft/
# Sync to AWS S3
aws s3 sync $BACKUP_DIR s3://my-bucket/minecraft-backups/Backup Schedule
Recommended backup frequency based on server activity:
| Server Type | Frequency | Retention |
|---|---|---|
| Low activity (1-5 players) | Daily | 7 days |
| Medium activity (5-20 players) | Every 6 hours | 14 days |
| High activity (20+ players) | Every 2-4 hours | 30 days |
| Production/SMP | Hourly + Daily | 90 days |
Restoring from Backup
Before Restoring
Always stop the server before restoring. Create a backup of the current state first, in case you need to revert.
Restore Steps
- Stop the server completely
- Backup current state (just in case)
- Extract the backup archive
- Replace the server files
- Verify file permissions
- Start the server
# Stop server first!
# Create safety backup
mv world world.old
mv plugins plugins.old
# Extract backup
tar -xzf backup-20240115-120000.tar.gz
# Set permissions
chown -R minecraft:minecraft world plugins
# Start server and verifyTesting Backups
Regularly test your backups to ensure they work:
- Create a test environment (separate server or local)
- Restore a backup to the test environment
- Start the server and verify world loads correctly
- Check player data, plugin configs, and builds
Best Practice
Test your restore procedure at least monthly. An untested backup is not a reliable backup.