DGuard

Moving a Minecraft server to a new host or VPS without losses

Moving a server is more than copying worlds. You need the plugins with their folders, the configs, the ban and OP files, the plugin databases, the same Java and server build, the right file owner, and a DNS switch that lets players join at the old address. Below is an order of work that keeps the old machine as a fallback until the new one is tested.

The DGuard team9 min read

In short: prepare the new machine with the same Java and the same server build, and lower your DNS record's TTL in advance. Then stop the server with stop, archive the server folder, dump the databases with mysqldump and move everything over. Test the copy by IP, and only then change the A record. Don't delete the old machine until the new one has run for a few days. The DGuard key moves along with the plugins folder.

The moving plan

StageWhat you doWhere players play
PreparationNew machine, Java, server build, firewall; lower the DNS TTLOn the old server
Maintenance windowstop, archive, database dump, copyServer closed
TestingStart on the new machine, join by IP, check pluginsServer closed
SwitchA record (and SRV, if the port changed) to the new IPOn the new server
WatchLogs, TPS, the DGuard panel; the old machine is off but intactOn the new server

Prepare the new machine

  • The same Java. Paper 26.1 and newer needs Java 25; 1.20–1.21.11 runs on Java 21. Compare java -version on both machines. Installing Java on Ubuntu and Debian is covered in Minecraft server on Linux.
  • The same version and build. A move is no time to update: carry over the same jar and update separately, later — see updating the Minecraft version.
  • User, folder, autostart. A dedicated minecraft user, the same folder (say, /opt/minecraft), the systemd unit and the backup cron jobs — move those too.
  • Firewall. Game port and SSH inbound, HTTPS outbound. Don't expose RCON or the ports of servers behind a proxy — see server IP and port.
  • Database server. If plugins write to MySQL or MariaDB, install it beforehand — see MySQL for plugins.

What to copy

WhatWhere it livesWhy
WorldsPaper 1.21.x: world, world_nether, world_the_end. From 26.1 everything is inside world (dimensions in world/dimensions/).Builds, chests, inventories and player progress
PluginsAll of plugins/: the jars plus folders with configs and dataClaims, homes, permissions (LuckPerms keeps them in an H2 file in its folder by default), the DGuard key
Settingsserver.properties, bukkit.yml, spigot.yml, config/ with Paper's configs, eula.txt, the start scriptSo the server comes up the same
Access and bansops.json, whitelist.json, banned-players.json, banned-ips.json, usercache.json in the server rootOPs, whitelist and bans
DatabasesMySQL, MariaDB or PostgreSQL outside the server folderPermissions, auth, economy; DGuard keeps its player dossiers in your MySQL too

The simplest approach is to move the whole server folder except logs, cache, libraries and versions — Paper recreates those. It's the same set as for a backup — more in server backups.

Archive, dump and copy

Only copy a stopped server: an archive of a world the server is writing at that moment can arrive with corrupted chunks. Announce a maintenance window, stop the server and run:

old machine
# old machine: the server is stopped (sudo systemctl stop minecraft or stop in the console)
cd /opt/minecraft
sudo tar -czf /root/mc-move.tar.gz \
  --exclude=./logs --exclude=./cache --exclude=./libraries --exclude=./versions .
# plugin MySQL databases; credentials live in ~/.my.cnf
mysqldump --single-transaction --databases minecraft > /root/mc-db.sql
# copy to the new machine
rsync -aP /root/mc-move.tar.gz /root/mc-db.sql admin@203.0.113.20:/tmp/
new machine
# new machine
sudo mkdir -p /opt/minecraft
sudo tar -xzf /tmp/mc-move.tar.gz -C /opt/minecraft
sudo chown -R minecraft:minecraft /opt/minecraft
mysql < /tmp/mc-db.sql          # a --databases dump creates the database itself
  • --single-transaction dumps InnoDB tables as a consistent snapshot; --databases adds the statements that create the databases themselves.
  • A dump of selected databases doesn't include MySQL users: create a user on the new machine with the same name and password your plugin configs use. If the configs pointed at an external database address, update it.
  • rsync -a keeps file permissions and modification times; -P shows progress and resumes an interrupted transfer. You can also copy the server folder directly without an archive: rsync -aP /opt/minecraft/ admin@203.0.113.20:/opt/minecraft/ — that user needs write access to the target folder.

File ownership and common errors

Files unpacked as root belong to root, and a server running as the minecraft user can't write them: access errors show up in the log, and the world and plugin data stop saving. So after unpacking, run chown -R minecraft:minecraft on the whole folder.

SymptomCause and fix
The server won't start, a class version errorWrong Java. Install the same version as on the old machine
The server doesn't listen on the portserver.properties still has the old machine's server-ip. Leave it empty so the server listens on every address, as the Minecraft Wiki recommends
Plugins can't reach the databaseNo MySQL user, or a wrong database address in the plugin config
The world "rolled back"A running server was copied, or the wrong archive. Copy again from a stopped server
Players lost their items and permissionsonline-mode changed, and with it the players' UUIDs — see below

If the server sits behind a proxy, update its address in the [servers] section of velocity.toml and the firewall rule that only lets the proxy's IP in — see setting up Velocity.

Test the copy before switching

  1. 1

    Start it and read the log

    Wait for the Done line and look through logs/latest.log for plugin errors — see logs and crashes.

  2. 2

    Join by IP

    DNS still points to the old machine, so connect to the new one's address: 203.0.113.20 or 203.0.113.20:port.

  3. 3

    Go through the checklist

    Worlds and builds, inventories, claims, permissions, economy, teleports; /plugins — every plugin loaded.

  4. 4

    Check the anticheat

    /dguard license shows the plan, the license state and the PacketEvents version.

Switching DNS: A and SRV

Players join by domain, so changing the A record to the new machine's IP is enough. An SRV record _minecraft._tcp.<domain> points not to an IP but to a name with an A record, so you only touch it if the port changed.

DNS after the move (example)
play.example.com.                  300  A    203.0.113.20
_minecraft._tcp.play.example.com.  300  SRV  0 5 25565 play.example.com.

Check the records with dig play.example.com A and dig _minecraft._tcp.play.example.com srv (nslookup -q=srv on Windows). The Minecraft Wiki warns that depending on the player's resolver, changes can take up to a day. Until caches refresh, keep the old machine with the server stopped: if it keeps running, some players will play on the old copy and lose that progress. If the domain is on Cloudflare, the game record must be "DNS only". More on records in server IP and port.

DGuard during a move

DGuard — the best anticheat for a modern Minecraft server — moves with the plugins folder: the key lives in plugins/DGuard/config.yml (license.key), and you don't need a new one. It needs the latest PacketEvents release next to it, and the new machine needs outbound HTTPS to the DGuard site — the anticheat needs no inbound ports.

Don't start the copy with the same key while the old server is running. On startup the copy becomes the key's owner, and DGuard on the old server locks until a restart, with a message that the key is running on another server. Stop the old server first — or remove the key from the copy's config while you test it.

The panel tracks the server by the heartbeat it sends every minute: as soon as the new machine starts, the server shows as "Online" again. If a server is silent for 10 minutes, DGuard messages you and your team's admins on Telegram or by e-mail — and again when it's back. A long move will trigger that message, which is expected; you can switch off the server's "Alert me if it goes silent" toggle for the duration.

FAQ

How do I move a Minecraft server to another host?

Stop the server, archive its folder (minus logs, cache, libraries, versions), dump the plugin databases with mysqldump, unpack everything on a new machine with the same Java and server build, test by IP, then change the domain's A record.

Which files do I need to move a server?

The worlds, the whole plugins folder, server.properties and Paper's configs, ops.json, whitelist.json, banned-players.json, banned-ips.json, plus dumps of external databases. Moving the entire server folder is simplest.

Why won't the server start after the move?

Usually the wrong Java version, files owned by root while the server runs as another user, or the old machine's address left in server-ip. Check logs/latest.log.

How long does a DNS change take?

As long as resolvers keep the old record cached — up to its TTL; the Minecraft Wiki warns it can take up to a day. That's why you lower the TTL before the move.

Do I need a new DGuard key after moving?

No. The key in plugins/DGuard/config.yml moves with the plugins folder. Just don't run the old and new servers at the same time with one key.

Sources

All sections

Run the best anticheat for modern Minecraft

DGuard catches all 47 kinds of cheats in our comparison — the closest rival, Intave, has 27. Full protection on every plan, free up to 30 players online.