EN · $ USD
Security, DDoS and Backups

How to Back Up and Restore a Minecraft Server

8 min read Updated: OyunBulut technical team

In short

When backing up a Minecraft server, back up the world folders, the plugins folder and the MySQL database separately. While the server is running, first run save-off and save-all flush, copy the files, then turn saving back on with save-on. After griefing, don't restore the whole world: try a CoreProtect rollback first, and if needed restore only the affected region file.

In this guide
  1. What should you back up?
  2. Why do you need save-off?
  3. Backing up through your panel
  4. Automatic backup script on Linux
  5. About H2 and SQLite files
  6. Restoring a backup
  7. Rolling back after griefing
  8. The 3-2-1 rule and testing
  9. Next step: leave room for your backups

The right way to back up a Minecraft server is to handle its three types of data separately: world files, plugin settings and data, and the database if you have one. Copying the folder directly while the server is running can produce a backup full of corrupted chunks, so you need to pause autosave before copying. This guide covers taking consistent backups, automating them, and rolling back after griefing with as little loss as possible.

What should you back up?

DataLocationHow oftenNote
Worldsworld/, world_nether/, world_the_end/1-4 times a dayPaper and Spigot keep the Nether and End in separate folders
Plugin settings and dataplugins/Once a day and before every changeEconomy, home and land claim data live here too
DatabaseMySQL / MariaDBAt the same time as the world backupLuckPerms, CoreProtect, AuthMe, economy plugins
Server settingsserver.properties, bukkit.yml, spigot.yml, config/Whenever you make changesSmall files; you can add them to every backup
Player listswhitelist.json, ops.json, banned-players.json, banned-ips.jsonOnce a dayLosing your ban lists is a pain

What you don't need to back up: logs/, cache/, libraries/, the server jar (you can download it again) and the tile folders generated by dynamic map plugins. Map tiles take up a lot of space and can be regenerated; including them in backups only eats disk space.

Why do you need save-off?

Minecraft stores the world as region files (region/r.X.Z.mca) and writes to them periodically while the server is running. If the server writes to a region file during the copy, a half-written file ends up in your backup. When you restore that backup, chunks can come back corrupted, reset or missing.

The fix is to turn off autosave for the duration of the copy:

save-off
save-all flush
# Copying files...
save-on
  • save-off: Temporarily stops the server from writing the world to disk. The game keeps running and changes are held in memory.
  • save-all flush: Writes all changes in memory to disk immediately and waits until it's done.
  • save-on: Turns autosave back on. If you forget this command and the server crashes, everything since the last save is lost.

The safest backup is one taken while the server is fully stopped. If you have a daily scheduled restart, put the full backup in that window and use the save-off method during the day.

Backing up through your panel

If your game panel has a built-in backup tool, it should be your first choice; it usually stops the server safely and archives the whole folder. If the panel supports scheduled tasks, you can schedule backups for specific times. For details, see our scheduling automatic backups in the game panel guide. If there's no panel tool, or you want a setup that also covers the database, use the script method below.

Automatic backup script on Linux

The script below sends save-off to the server over RCON, puts worlds and settings in separate archives, dumps the database and deletes backups older than 14 days. For RCON, set enable-rcon=true, rcon.port=25575 and a strong rcon.password in server.properties; never expose the RCON port to the internet. The script uses mcrcon, a command-line RCON client. Variable names are in Turkish: SUNUCU is the server folder, HEDEF the backup destination and TARIH the date stamp.

#!/usr/bin/env bash
set -euo pipefail

SUNUCU=/home/minecraft/sunucu
HEDEF=/home/minecraft/yedekler
TARIH=$(date +%F-%H%M)
RCON="mcrcon -H 127.0.0.1 -P 25575 -p RCON_SIFRENIZ"

mkdir -p "$HEDEF"

# Turn saving back on even if the script fails
trap '$RCON "save-on"' EXIT

$RCON "save-off" "save-all flush"
sleep 5

tar -czf "$HEDEF/dunya-$TARIH.tar.gz" -C "$SUNUCU" world world_nether world_the_end

$RCON "save-on"
trap - EXIT

tar -czf "$HEDEF/ayar-$TARIH.tar.gz" -C "$SUNUCU" --exclude='plugins/*/web/tiles' plugins config server.properties bukkit.yml spigot.yml whitelist.json ops.json banned-players.json banned-ips.json

mysqldump --single-transaction -u mcyedek -p'VERITABANI_SIFRESI' minecraft > "$HEDEF/db-$TARIH.sql"

find "$HEDEF" -type f -mtime +14 -delete

To run the script every 6 hours, add this line with crontab -e:

0 */6 * * * /home/minecraft/yedek.sh >> /home/minecraft/yedek.log 2>&1

Instead of putting the database password in the script, it's safer to keep it in a ~/.my.cnf file that only you can read. The --single-transaction option takes a consistent snapshot of InnoDB tables without locking them; it's the right way to back up a database while the server is running.

About H2 and SQLite files

Plugins that don't use MySQL keep their data in local files inside plugins/: LuckPerms' H2 file, CoreProtect's database.db file, AuthMe's SQLite file and so on. These files aren't affected by the save-off command; if they're copied while the server is running, they can occasionally end up inconsistent. If this data is critical to you, move those plugins to MySQL or take the full backup while the server is stopped.

Restoring a backup

  1. Stop the server completely. Uploading files to a running server lets it overwrite them with the old world when it shuts down.
  2. Don't delete the current world; rename it to keep it, for example rename the world folder to world_bozuk ("world_broken"). That way you have a fallback if the restore fails.
  3. Extract the backup into the server folder:
cd /home/minecraft/sunucu
mv world world_bozuk
tar -xzf /home/minecraft/yedekler/dunya-2026-12-01-0600.tar.gz
  1. Restore the database from a dump taken at the same time. If the world and database come from different points in time, you'll get problems such as CoreProtect records not matching the world:
mysql -u mcyedek -p minecraft < /home/minecraft/yedekler/db-2026-12-01-0600.sql
  1. Start the server, check the console for errors and walk around a few areas in game.

If you're moving a world from another computer or a singleplayer save, the folder structure may be different; for that case, see our uploading a map to your Minecraft server guide.

Rolling back after griefing

When a player burns down your base, the first instinct is to roll the whole world back to yesterday's backup. That also wipes out every other player's work from the last few hours. Here's the right order:

1. Undo it with CoreProtect first

CoreProtect is a plugin that logs changes such as block breaks and placements, chest transactions and fire. If it's installed, you can undo only what the attacker did:

# Click a block to see who did what
/co inspect

# List the player's actions from the last 3 hours
/co lookup u:Oyuncu t:3h

# Undo everything the player did in the last 3 hours across the whole world
/co rollback u:Oyuncu t:3h r:#global

# If you rolled back the wrong thing, reverse it
/co restore u:Oyuncu t:3h r:#global

Replace Oyuncu ("Player") with the griefer's username.

2. If needed, restore only the affected region

If CoreProtect isn't installed, or the damage was done in a way it doesn't log, you can restore just the relevant region file instead of the whole world. Each region file covers a 512x512 block area. To find the file name, divide the coordinate by 512 and round down: the point X=1200, Z=-300 is in r.2.-1.mca.

  1. Stop the server.
  2. Take world/region/r.2.-1.mca from the backup and replace the current file with it.
  3. Because current versions store entities and points of interest separately, also replace the files with the same name in the world/entities/ and world/poi/ folders.
  4. Start the server and check the area.

This way only the attacked area is rolled back; players' work in the rest of the world is preserved.

The 3-2-1 rule and testing

If your backup is on the same disk as the server, it's lost along with the server if the disk fails or the account is compromised. The widely accepted 3-2-1 rule: at least 3 copies of your data, on 2 different storage media, with 1 copy off the server. In practice, keep local backups on the server and download a daily copy to cloud storage or your own computer. If you have a second server with SSH access, you can sync the backup folder there every night with rsync:

rsync -az --delete /home/minecraft/yedekler/ yedek@ikinci-sunucu:/yedekler/minecraft/

Here, the --delete option also deletes old backups on the destination once they're deleted at the source; remove it if you want to keep a longer history on the remote side. Connecting to the remote server with a separate user that only has write access makes it harder to delete your backups even if the main server is compromised.

A backup you've never tested is a backup you only assume you have. Once a month, restore a backup to a separate test server and check that it starts. A full backup is also a must before any version upgrade; details are in our changing your Minecraft server version guide.

Next step: leave room for your backups

Local backups use disk space; a few days of compressed world archives fill up a growing survival server quickly. The OB-MC-3 Minecraft server, with 8 GB of RAM and 55 GB of NVMe SSD storage, leaves comfortable room to keep a few days of local backups while running a plugin-based survival server. For bigger worlds and a longer backup history, you can compare the higher plans on the Minecraft server plans page. OyunBulut servers run in our Istanbul data center with NVMe disks and DDoS protection; if you get stuck while setting up your backups, open a ticket with our support team. If you're setting up a new server, prepare your backup plan on day one; starting with OB-MC-3 and putting the script from this guide in place during the first week will save you hours of work the first time someone griefs your server.

Frequently asked questions

Can I back up a Minecraft server while it's running?

Yes, but first run save-off and save-all flush, and turn saving back on with save-on once the copy is done. Otherwise, half-written region files can cause corrupted chunks.

How often should I back up my Minecraft server?

For an active survival server, backing up the world 1-4 times a day, plugin settings once a day, and everything before any major change is a good start. You can keep backups for 7-14 days depending on your disk space.

Do I need to restore the whole world after griefing?

Usually not. If CoreProtect is installed, you can undo only the attacker's actions with /co rollback; if not, you can restore just the affected region file from a backup.

Should backups include the entire plugins folder?

Settings and data files should be included, but you can exclude large, regenerable caches such as the tile folders created by map plugins.

How do I back up a MySQL database?

The command mysqldump --single-transaction -u user -p database > backup.sql takes a consistent dump without stopping the server. To restore it, use mysql -u user -p database < backup.sql.

For this guide

Recommended plans

If you want to keep a few days of local backups while running a plugin-based survival server, OB-MC-3's 55 GB NVMe disk and 8 GB of RAM give you balanced headroom.

OB-MC-3

Recommended

8 GB RAM

$6.88/mo

+VAT

  • Processor4 CPU
  • Disk55 GB NVMe
  • LocationIstanbul
  • DDoS Protection
  • Automatic Setup
  • Web Panel
  • 7/24 Support

2 GB RAM

$3.54/mo

+VAT

  • Processor2 CPU
  • Disk20 GB NVMe
  • LocationIstanbul
  • DDoS Protection
  • Automatic Setup
  • Web Panel
  • 7/24 Support

6 GB RAM

$5.31/mo

+VAT

  • Processor4 CPU
  • Disk45 GB NVMe
  • LocationIstanbul
  • DDoS Protection
  • Automatic Setup
  • Web Panel
  • 7/24 Support

Minecraft — tüm paketler

Need help with setup?

Send questions about your service in a support ticket, and our technical team will walk you through it step by step.