Thursday, January 02, 2014

Recovering a Lost Minecraft World

I've run into the problem of needing to recover a lost Minecraft world from file backups manually a few times now and I always seem to forget the process. There are a few YouTube videos and other miscellaneous (and often conflicting) forum posts suggesting approaches to accomplish this, so I thought I'd document the process I've found successful for future reference.

First off, it's worth noting that this process is designed to recover a world that is no longer showing up in Minecraft's available world list. This is not a tutorial for recovering lost files (there are plenty of other places to look for such information). If you do not have a backup of your world files, you should seek help elsewhere.

Minecraft world data is saved in the following path on a Windows system:

%AppData%\.minecraft\saves

Which will ultimately resolve to a path like the following:

C:\Users\<username>\AppData\Roaming\.minecraft\saves

Inside this folder you will find directories containing each of your worlds. Whether or not these are actually showing up in Minecraft appears to relate to the metadata stored in the level.dat file within each sub-directory.

In order to recover your world, what you will want to do first is run Minecraft and create a brand new world as a placeholder. This world should be created with the same game type (Survival/Creative) as the one you are looking to restore. Once you have created a new world, simply save and exit back to the Minecraft menu.

At this point you should see the folder for your newly created world. Note that while it appears that Minecraft will append characters to the end of the world name to avoid directory collisions in the saves folder, you might want to err on the safe side and give your new placeholder world an entirely different name from the one you are restoring.

The next step is to go into the newly created placeholder world's directory and delete or rename the following directories: region, DIM1, and DIM-1 (the main world, nether, and end world, respectively). Once that has been done, copy the same folders from the directory containing the data for the world you are trying to recover and paste them into the placeholder world's save directory.

Once this is done, start the placeholder world from within Minecraft and you should find yourself in the restored world. One thing to note: Any player data you may have had will be lost (you can possibly recover this by overwriting the players directory as well, but I have not tested this). Also note that you will start at whatever initial spawn point the newly created placeholder world set and thus you may spawn underground, high in the air, or in some other strange location relative to where you actually want to be. If you're having trouble finding where to go to find your restored data (due to it not being near the default spawn) you can utilize programs such as Cartograph G to map out the world for reference.

There are probably programs that you can find that will perform this entire backup/restore process for you, but if you happen to find yourself with a missing world and nothing but some backed up files to show for it, hopefully this guide helps.

More information about all of the files and folders contained within the Minecraft saves folder can be found here.