Lesson 6 of 9 · 26m
Backups, Restore Drills, and Disaster Recovery
Build crash-consistent and clean backup procedures, protect configuration as well as worlds, rotate copies off-host, and rehearse restoration before corruption happens.
The backup you have never restored is a rumor. Minecraft worlds are live databases made of region files, player data, entity data, plugin state, and configuration. Copying world/ occasionally is better than nothing, but serious operations need consistency, retention, off-host copies, and a restore runbook someone else can follow at 2 a.m.
Know what must be backed up
A complete server state usually includes:
world*/ terrain, entities, dimensions
plugins/ plugin configuration and data
server/core YAML and JSON configuration plus admin stateCoordinate the write boundary
Minecraft writes continuously. A naive copy can catch files mid-write. At minimum, flush saves first:
mcrcon -H 127.0.0.1 -P 25575 -p "$RCON_PASSWORD" 'save-all flush'
rsync -a --delete /opt/minecraft/main/ /srv/backups/minecraft-stage/For stronger consistency, briefly stop writes with save-off, copy, then re-enable them:
mcrcon ... 'save-off' 'save-all flush'
rsync -a /opt/minecraft/main/ /srv/backups/minecraft-stage/
mcrcon ... 'save-on'This can stall gameplay and is dangerous if automation forgets save-on. Prefer filesystem or volume snapshots when available; they make the copy atomic at the storage layer while Minecraft remains online.
Keep copies off the machine
A backup beside the server protects against mistakes, not host compromise or disk death. Push encrypted archives to object storage with restic:
restic -r s3:s3.us-east-va.io.cloud.ovh.us/mc-backups backup /srv/backups/minecraft-stage
restic -r s3:s3.us-east-va.io.cloud.ovh.us/mc-backups forget --keep-hourly 24 --keep-daily 14 --keep-weekly 8 --pruneEncrypt the repository and store the password outside the host. If ransomware or a bad administrator reaches production, they should not also reach every recovery copy.
Restoration is the product
Write a runbook with exact commands and decision points:
1. Stop the server and preserve the damaged directory as evidence.
2. Restore the selected snapshot to a clean directory.
3. Inspect compatibility, then boot isolated or with a whitelist.
4. Verify spawn, inventories, claims, shops, and logs.
5. Announce cause, data-loss window, and next steps.Then rehearse it. Time the restore. Test plugin state, not merely whether the login screen appears.
Field notes
- A corruption event plus an hourly backup rotation can overwrite all good copies before anyone notices; keep deeper retention.
- Restoring only terrain while leaving broken plugin state can duplicate items, claims, or currency.
- Never test restore over the only production copy.
- Monitoring free disk space is backup operations too; many corruption stories begin with a full disk.
Was this lesson helpful?