Backups
How to back up a Minecraft server (and restore it)
Every long-running world eventually has a bad day. A crash that corrupts a region file, a griefer who got hold of the wrong command, a plugin update that rearranges something it shouldn’t, a hard drive that just stops. People who have a backup shrug. People who don’t lose a year of builds.
Backing up a Minecraft server is simple, which makes it all the stranger how many people never do it.
What to copy
The world is a folder. On a Vanilla server it’s called “world” unless you changed level-name in server.properties, and the Nether and the End are stored inside it. On Spigot and Paper servers the dimensions are separate folders, usually named world_nether and world_the_end.
Copy those, but copy more than the world if you have anything set up. The plugins folder with its configuration files holds your permissions, your shops and your home locations. A modded server needs its mods and config folders. Also keep server.properties, whitelist.json and ops.json.
The simplest rule is to back up the whole server folder. It takes more space, but you never find out later that you skipped the one file that mattered.
When it’s safe to copy
Copying a world while the server is writing to it can give you a broken backup. It may look fine and then fail to load the day you need it.
The cleanest approach is to stop the server first, copy the folder, and start it again. If you can’t stop it, the server has commands that help. Run these in order from the console:
save-off
save-all flush
(copy the folder now)
save-onsave-off pauses automatic saving, save-all flush forces everything in memory onto the disk, and save-on switches saving back on. Don’t forget that last one. Leaving saving off and walking away is how people lose a day of progress.
Where to keep them
A backup that sits on the same drive as the server only protects you from mistakes, not from the drive dying or being stolen. The common advice is to keep copies in at least two places, and at least one of them somewhere else.
A second drive helps, and a cloud folder helps more. Mineshire can send backups to your Google Drive as well as keeping them on your PC.
Check that old backups don’t pile up forever. A world grows over time, and thirty full copies can eat a whole disk. Keeping the last week or two daily and a few older ones is plenty for most servers.
Making it automatic
You will forget to do it by hand. Everybody does. Use something that runs on a schedule instead.
In Mineshire you add a backup plan with a time and the days you want. Two details are worth knowing. Backups need the server stopped, so a plan skips a server that’s still running. And plans only run while Mineshire is open, so a PC that’s switched off won’t make one.
Restoring
Stop the server. Move the current world folder out of the way instead of deleting it, since it might still have something useful. Copy the backup’s world folder into place with the right name, and start the server.
The important habit is to test a restore once, when nothing is wrong. Put a backup on a spare folder, start a server from it, and see that you can walk around in it. A backup you’ve never opened is only a hope.
Quick answers
How much space does a backup take? It depends on how much of the world has been explored, and it only grows over time. Check one backup’s size and multiply it by how many you plan to keep.
Is copying the world while it runs really that risky? It often works and sometimes doesn’t, and you only find out when you restore. The save commands exist so you don’t have to gamble.