Tutorials

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:

DirectoryContentsPriority
world/Main world data, player dataCritical
world_nether/Nether dimensionCritical
world_the_end/End dimensionCritical
plugins/Plugin JARs and configurationsHigh
server.propertiesServer configurationHigh
*.jsonBans, whitelist, operatorsMedium
logs/Server logsLow

Backup Methods

Manual Backup

For quick one-time backups:

  1. Run save-all in the console to flush changes to disk
  2. Run save-off to pause auto-saving
  3. Create your backup (copy/compress files)
  4. Run save-on to resume auto-saving
Terminal
# 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 *.json

Automated Backups

Set up scheduled backups with cron (Linux):

crontab -e
# 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.sh

Backup Script Example

backup.sh
#!/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

Sync to remote server
# 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 TypeFrequencyRetention
Low activity (1-5 players)Daily7 days
Medium activity (5-20 players)Every 6 hours14 days
High activity (20+ players)Every 2-4 hours30 days
Production/SMPHourly + Daily90 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

  1. Stop the server completely
  2. Backup current state (just in case)
  3. Extract the backup archive
  4. Replace the server files
  5. Verify file permissions
  6. Start the server
Restore commands
# 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 verify

Testing Backups

Regularly test your backups to ensure they work:

  1. Create a test environment (separate server or local)
  2. Restore a backup to the test environment
  3. Start the server and verify world loads correctly
  4. Check player data, plugin configs, and builds

Best Practice

Test your restore procedure at least monthly. An untested backup is not a reliable backup.