Jump to content

Dedicated Server conversion from old to new format


Recommended Posts

DISLCAIMER: I'm not sure if it was always possible to run both server instances from the same directory or not, I never actually tried. The above is only for those that had two separate copies of the server in two separated directories. This is how I combined them into one directory. It was all of five minutes of work if that.

For those of you who were running separate dedicated servers with separate directories for Master and Cave, I found that all you have do to convert to the new format is move your slave config directory into the same directory as your master config directory, and change the startup script for the slave to use the same binary as the master. You still have to run two instances of the server, but now you can do it from the same directory.

When you first start the server, it will migrate your settings to the new format, but this is transparent, and everything should work like it always has. It will create your server.ini, cluster_token.txt files, etc., all automatically. Surprisingly, it works very well, and there is zero additional config to do - at least none that I have yet found. YMMV.

You will notice I use the --persistent_storage_root flag and -conf_dir flags to force it to keep everything in the /home/<user>/dst_test directory. This makes it easier to backup the server, everything is self-contained in the same directory, and if I want to move the server to another machine, I just copy the ./dst_test directory and I have everything, binaries, config, saves, etc.

Example: Before, I was running two complete copies of the dedicated server in:

/home/<user>/dst
/home/<user>/dst_cave

In each of them I had a conf directory, and in that directory I had a directory for the master or slave server settings and config etc:

/home/<user>/dst/conf/dst_master
/home/<user>/dst_cave/conf/dst_cave

The dst server files were installed into ./dst and ./dst_cave, so each of these directories had their own copy of the expected bin, data, mods, steamapps directory, etc. I put all of my config/save/etc. stuff in a conf directory to separate them from the server files. I hope that makes sense. In the master server, I had these directories:

bin
conf (the directory where all settings and saves and world and etc is kept in)
data
mods
dontstarve.xpm
go.sh (the script that starts the server)
version.txt

In the above case, I simply copied the /home/<user>/dst_cave/conf/dst_cave directory to /home/<user>/dst/conf/dst_cave. Then I copied the startup script, called it go_cave.sh and modified it to point to the executable in /home/<user>/dst/bin, which is what the master used all along. I did NOT touch the script that starts the master server.

For clarification purposes, here is my startup scripts. Note that I got rid of most of the stuff most people used and just use the bare minimum to start the server:

cd /home/<user>/dst_test/bin
/home/<user>/dst_test/bin/dontstarve_dedicated_server_nullrenderer   -console --persistent_storage_root /home/<user>/dst_test/conf -conf_dir dst_master

and:

cd /home/<user>/dst_test/bin
/home/<user>/dst_test/bin/dontstarve_dedicated_server_nullrenderer   -console --persistent_storage_root /home/<user>/dst_test/conf -conf_dir dst_cave

The only difference is the -conf_dir flag setting - one points to the master, one points to the cave

The above works well. I'm not sure if Klei would consider it the politically correct way to do this, and maybe this is a horrid kluge, but it is what I do, and as I said it works very well.

YMMV

 

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

Please be aware that the content of this thread may be outdated and no longer applicable.

×
  • Create New...