Which files make up a world
A vanilla Terraria world is one file with a .wld extension, as our move-a-world guide covers. A tModLoader world is two files that share a name: the tModLoader wiki's restore steps tell you to copy both WorldName.wld and WorldName.twld, and its backup instructions also name .wld.bak and .twld.bak files as files not to copy, advising you to turn on file name extensions so you do not mix them up (tModLoader - Basic Usage Guide).
The practical rule for a modded world is that the pair travels together. Copy both, back up both, restore both. A backup that holds only one of the two is incomplete, and so is a restore that mixes a .wld and a .twld taken on different days. The server's start flag points at the .wld, not the .twld (see the tModLoader on 1.4.5 guide), so it is easy to remember one file and forget the other.
Save first, then exit, then copy
Copy world files while the server is stopped. The Terraria Wiki's console list gives the safe sequence: save saves the game world, and exit shuts the server down and saves, while exit-nosave shuts it down without saving (Terraria Wiki - Server). The reasons and the autosave details are in our move-a-world guide and the setup guide; the console commands are listed in the admin commands guide. Run save, then exit, and only then touch the files.
Where the files live
Vanilla on Linux. The Terraria Wiki's server instructions say to put world files in ~/.local/share/Terraria/Worlds/ for the server to find them, which makes that the folder to copy from (Terraria Wiki - Server). Other platforms are covered in the move-a-world guide.
tModLoader. Its save folder name depends on the version: the tModLoader wiki lists tModLoader-1.4.3 for 1.4.3, tModLoader for 1.4.4 and tModLoader-preview for the 1.4.4 preview, with ModLoader for 1.3. Under that name, the wiki's save locations are ~/.local/share/Terraria/<folder>/ on Linux (or $XDG_DATA_HOME/Terraria/<folder>/), %UserProfile%\Documents\My Games\Terraria\<folder> on Windows and ~/Library/Application support/Terraria/<folder>/ on a Mac. The worlds sit in a Worlds folder inside it (tModLoader - Basic Usage Guide).
A tModLoader dedicated server is different. There the folder depends on the launch flags. The tModLoader command-line page says -savedirectory sets the save directory and that /tModLoader (with the version-specific variants for 1.3 and 1.4.3) is added to the path you give; -tmlsavedirectory is the same except that /tModLoader is not added to the path (tModLoader - Command Line). So the same path can land in two different places depending on which flag your start script uses. We do not claim a default folder for a dedicated server: read the flags in your own start script, or the world= line in your serverconfig.txt (see the serverconfig reference), to find where your files are.
Back up: the steps
- Run
save, thenexit, and wait for the server to stop. - Open the folder that holds your world: the
Worldsfolder for vanilla, or theWorldsfolder under your tModLoader save folder. - Copy the world file, or for tModLoader both the
.wldand the.twld, to a dated folder somewhere that is not the server's own folders: another drive, or another machine. - Start the server again, or leave it stopped if you are about to change something.
If you cannot see the files on your own PC, the tModLoader wiki says the world may be stored in the cloud, and to move it off the cloud first. Our backup checklist turns the habit into a routine for every game you run.
Restore: the steps
- Stop the server with
savethenexit. Do not swap world files under a running server. - Copy the current files aside first: the
.wld, and for tModLoader the.twldtoo. The tModLoader wiki's own restore steps begin the same way, with a safe spot for the current files. - Replace both files of the pair with the backup copies. For vanilla that is the one
.wld. - Check that the filename matches the
world=entry in yourserverconfig.txt. That line loads the world named in it, and the wiki's example isworld=C:\Users\Defaults\My Documents\My Games\Terraria\Worlds\world1.wld. The entry names the.wld, and for tModLoader the.twldwith the same base name belongs beside it. A mismatch is the mistake behind the "new world instead of mine" trap described in the move-a-world guide. - Start the server and read the console. Join and look at the world before you tell anyone it is back.
Using .bak files and tModLoader's dated zips
The zips. The tModLoader wiki says world backups live in Worlds\Backups inside the save folder, as zips named with the date and then the world name; its example is 2021-02-21-CoolTown.zip. Its restore steps are: copy the current .wld and .twld to a safe spot, open the newest zip and copy its contents, go back to the Worlds folder and paste, choosing to replace the files in the destination, then launch and try to load the world. If it does not load, it says to repeat with the next most recent zip (tModLoader - Basic Usage Guide). On a server, do the same with the server stopped. That page describes the game's own Worlds folder; we have not tested whether a dedicated server writes the same dated zips, so check your server's save folder for a Backups folder rather than assuming one exists.
The .bak files. The tModLoader wiki names .wld.bak and .twld.bak files only in its backup instructions, as files not to copy, and gives no location for them, no word on when they are written and no way to restore from them, and the Terraria Wiki's server page does not mention them at all. So this page does not hand out a recovery procedure for them. If you want to try one, copy the current pair aside first and work on copies, keeping the .wld.bak and .twld.bak together, the same way you would keep the pair together. The server's rolling world backups, set by worldrollbackstokeep, are described in the move-a-world guide.
Where to read next
The move-a-world guide covers getting a world onto and off a server, the setup guide covers the install and autosave, the serverconfig reference covers world= and its neighbours, the tModLoader guide covers the modded server, the backup checklist covers every game, and moving a server to a new host covers the day everything moves.