A very powerful feature of WorldEdit is that it can load a section of your world, defined by your selection region, and restore it from a backup without having to shutdown your server or use an offline map editor. A large number of problems can be easily fixed this way, from undoing a griefer's work to fixing a world save error to even rolling back from a project you gave up with half-way through.
In order for WorldEdit to be able to read your backups, you will have to choose a directory to place backups inside. Once set, just toss either copies of your world folder or zipped copies of your world folder into your backup folder. An example of how you could lay out your backups folder is below.
- backups/ (this is the folder holding the backups)
You can freely mix and match different types of backups and WorldEdit will be able to use them all. To tell WorldEdit what your snapshot folder is, you need to modify the snapshots directory configuration parameter and input the path to your backups folder. You can use a relative path or an absolute path. The relative path uses your server .jar file as its starting point.
If you want WorldEdit to restore as fast as possible, you may consider putting the backups on some fast hard drives
WorldEdit does expect the backup folders and files to be named a certain way. It uses the filename to determine which backup is newer and which backup is older. It currently does not use a file's modification date because that is not always accurate (especially when you start copying around files a lot), so rather WorldEdit attempts to sort the filenames in descending order (Z to A) and pick out the top entry. It works best when your names are named so that they include zero-padded numbers, such as YYYY-MM-DD.
zip -v backups/`date "+%Y-%m-%d-%H-%M-%S"`.zip -r world
Supported archive formats
At the moment WorldEdit only supports ZIP files. TAR files are not supported because the TAR format does not have a central index, meaning that WorldEdit would have to read through the entire file to figure out where a certain file is. As Minecraft stores each chunk as its own separate file and maps have a lot of chunks, a format like ZIP that supports fast random access is absolutely required.
WorldEdit will automatically use Java's ZIP library in order to open the ZIP files, but it can't handle all types of ZIP files. If you receive cryptic errors when attempting to use ZIP files as snapshots, you should install TrueZIP. WorldEdit will automatically use TrueZIP if it is present.
/snap use <snapshot-name>
/snap use latest
/snap list [count]
Restoring from backup is easy! Use
//restore [snapshot-name] to restore the region (after selecting one).
By default, WorldEdit will automatically select the newest backup to use unless you a explicitly specify a snapshot.
To select a different snapshot, you can either specify it with //restore or you can use
/snap use <snapshot-name>. If you use /use, then you don't have to constantly type the snapshot's name with /restore. To let WorldEdit select the newest backup again, use
/snap use latest. To list the newest snapshots that are available, use
/snap list [count].