Minecraft – change the Minecraft server path

minecraft-java-editionminecraft-java-edition-server

I'd like to move my Minecraft server to a Dropbox folder, but I don't know how to do it. Is it possible? Is it safe?

I'm using Ubuntu 11.10. Minecraft server created the world and server options in the user home folder, /home/user. Is there a way to move all Minecraft server data to /home/user/Dropbox/minecraft?

Best Answer

The Minecraft server simply uses the current working directory to store its files. Moving the data is as easy as actually moving it and starting the server with a different working directory.

How you do that is mostly up to you. Windows shortcuts allow you to set the working directory, as do batch files or Linux shell scripts. Since you mentioned you're using Ubuntu, this simple shell script should do the trick:

#!/bin/bash
cd /home/user/Dropbox/minecraft
java -Xmx1024M -Xms1024M -jar /home/user/minecraft_server.jar &

However, as BlaXpirit pointed out, Minecraft's server files are frequently written, and Dropbox does store all versions of synced files. Depending on the popularity of your server, this might put unnecessary strain on your network and Dropbox's service. If you just want a backup, scheduling a job to periodically move the server files to your Dropbox folder might be a better idea.