Hey, I've been noticing a fair bit of people having their computers/minecraft crash one way or another which causes some files to corrupt.
I took 5 minutes to write a small app that will backup the files that get corrupted while you play and in the background.
DOWNLOAD:http://www.mediafire.com/?k7o2dmo69qxb4py
What it does/How it works:
It finds your appdata folder (in case you have moved it)
Checks if minecraft is open. If false it loops at a cycle of two and a half minutes.
If true checks each world save (1-5) copying the session.lock, level.dat, and level.dat_old to a folder created on the desktop.
Once copying is completed. The app is set to wait two and a half minutes before it starts over.
It overwrites each time it copies so it wont make infinite appends, and each copying cycle is 2 and a half minutes so If minecraft crashes close it down before that time.
I might make it append a couple times late on but that's just extra code to type lol
If Minecraft crashes and your world disappears from the loading menu. Follow these quick steps to try and fix it.
1. Locate your world save (%appdata%\.minecraft\saves\world#
2. delete level.dat, and rename level.dat_OLD to level.dat
3. If that still doesn't work, open up Minecraft Level Data on the desktop
4. Select your world number, then copy and overwrite the session.lock, level.dat, level_old into your main World save file.
5. If it still doesn't want to work for you, repeat step 2.
6. Get those same three files from a previous full backup.
If all else fails, start your world back up on the same save slot (not recommended imo) and search for your buildings from your new spawn point.
** To close/stop it press "SHIFT + ESC", It should stop it, if not go into task manager and end the task Painfulleap's MC world data backup.exe. You can tell it's running by a blinking icon in the trask bar
THIS DOES NOT BACK UP CHUNK DATA. only the files which relate to player inventory, location, and other small things contained in session.lock, level.dat, and level.dat_old
Rollback Post to RevisionRollBack
Billing and Hacking concerns Email [email protected] Use clear and simple subjects Other issues getsatisfaction.com/mojang
"Typing URGENT in the subject line makes my brain mark it as spam. Please dont do it."
You should write a program to restore the backup, too.
That's too much effort lol, I'd need to make a gui or some way in to select which world to recover which is fine and all, but I'd rather not take extra time to make it nor do I want to have the possibility of it accidentally messing up and overwriting when it shouldn't :smile.gif: Right now it runs nicely in the background and the chances of your save getting corrupted is pretty small but when it does happen. The 30 seconds to manually replace the corrupted file yourself doesn't seem like much of an issue.
Rollback Post to RevisionRollBack
Billing and Hacking concerns Email [email protected] Use clear and simple subjects Other issues getsatisfaction.com/mojang
"Typing URGENT in the subject line makes my brain mark it as spam. Please dont do it."
So far it seems to have worked for me, Took about a dozen times of crashing minecraft for a test world to get corrupted.
Used the backups and it worked perfectly. All items were restored (other than a few new ones) the player location is set wherever the backup was taken (of course :wink.gif: ) so you might be a dozen steps from where the game crashed.
Rollback Post to RevisionRollBack
Billing and Hacking concerns Email [email protected] Use clear and simple subjects Other issues getsatisfaction.com/mojang
"Typing URGENT in the subject line makes my brain mark it as spam. Please dont do it."
I wish there was one that backs up you're whole world to a different folder. It's always one save behind. The next time you load it asks: Backup previous session? Yes No So if you find you're world got destroyed by the invisible world glitch you can easily get the last save.
ah, your right I never really thought of that XD I'm sure if my game crashed more often I would have caught on haha Sorry if it caused your game problems
When I get some time I'll update it. I'll probably make it append a dozen times or so because I don't want it to have any pop ups. I'm trying to get it to run in the background without any gui or settings needed just simply open and your good to go.... I guess I could change it so it infinitely appends as long as you guys remember to remove some of the old unneeded files. Probably have it backup every 5 minutes, 12 an hour? I don't know I'll think about it a bit. But i'm willing to take suggestions :wink.gif:
Also backing up the entire world save (including chunks) causes excessive lag when it copies and takes to long depending on the size of the worlds
Rollback Post to RevisionRollBack
Billing and Hacking concerns Email [email protected] Use clear and simple subjects Other issues getsatisfaction.com/mojang
"Typing URGENT in the subject line makes my brain mark it as spam. Please dont do it."
So I was toying with an idea to write something somewhat like this in Java or something that would basically be an automatic rudmentary versioning system for MC saves (that would work without too much lag at least until Notch makes saves in to huge single files).
Basically, it would mirror your entire save folder to some arbitrary place on your HD, then every minute or so, run through the files in MC's save folder, checking for any files that had been changed since last backup, and back them up to subfolders in the mirror built at each timestamp for which an update occured. Then have some sort of command line operation to rebuild a save based upon an arbitrary timestamp you pass in that you could copy back in place of a corrupted save. This would, at least in theory, give you access to any arbitrary historical point in your save without the overhead of copying your entire pile of save data at every traul (so it would suck less HDD and not cause out of synch errors from trying to copy the entire save folder and having things changed in the middle). I know it wouldn't be bullet proof, but since it would be versioned, you could easily step back if you had a particular backup that was bad. Of course it could also clean up after itself and delete data older than 5 or 10 versions ago or something so it wouldn't slowly eat your entire HDD...
Rollback Post to RevisionRollBack
Quote from Adam222 »
So, yeah. Minecraft is kind of like walking into a high-class auction with top security and a solid reputation only to find out that everyone else in the room is a mugger. Who explodes.
That would work decently if you got it working before the new single save file came out.
I was thinking of making an entire world saver that automatically backed up when minecraft was closed. Wouldn't be too hard something like if window open>Minecraft* check every 5 minutes, once found start looping a new if window open>minecraft* every 5 minutes and when it comes back false create an entire backup of saves based on modified date Then go back to start. maybe not individual chunks based on when they were updated but the whole save even add it to compressed zip or rar. have it delete old backups after a successful new backup and rename it.
anyways I still need to figure out a new way to backup files which have a tendency of corruption and at the same time only backup the good ones and not accidentally overwrite with corrupted ones. All the while having no way to tell if a file is corrupt or not
Rollback Post to RevisionRollBack
Billing and Hacking concerns Email [email protected] Use clear and simple subjects Other issues getsatisfaction.com/mojang
"Typing URGENT in the subject line makes my brain mark it as spam. Please dont do it."
I think some rudimentary versioning is somewhat important, as you could be down in a mine and have a chunk error take out your house top side without even knowing it for many a successful enter/exit cycle. And yeah, once single file saves are implemented, all these sorts of things will become much more difficult...
Rollback Post to RevisionRollBack
Quote from Adam222 »
So, yeah. Minecraft is kind of like walking into a high-class auction with top security and a solid reputation only to find out that everyone else in the room is a mugger. Who explodes.
Glad it helped. Odd its being detected as a virus... there isn't anything in it unless someone flagged it as suspicious. You could mark it as safe and it will work properly.
Upload it to virus total for proof it's clean :smile.gif:
Anyways It's outdated I no longer have the source code (not that it was hard to make) but this current version ONLY works for worlds 1 - 5. With the new ability to have unlimited worlds and change name to anything this will not work for those. If you use one of the original 5, I would recommend using this. It's saved me a few times.
The main features of this is it checks every few minutes if minecraft is running. If it is it starts a new countdown of a few minutes when the timer runs out, it copies the level.dat and what not from the 5 world save folders then pastes it in a folder on the desktop and starts the loop again. If minecraft is not found to be running the program goes into a separate loop of checking every 5 or 10 minutes for minecraft to start running. Not sure how any of that could get detected as a virus XD
I might consider creating a new one when I get some time.
Rollback Post to RevisionRollBack
Billing and Hacking concerns Email [email protected] Use clear and simple subjects Other issues getsatisfaction.com/mojang
"Typing URGENT in the subject line makes my brain mark it as spam. Please dont do it."
This worked!!! Saved my world that i'd been working on for forever, i was finishing up my city in the sky when my laptop overheated and turned off so i literally went ballistic looking for a solution.
For you
Rollback Post to RevisionRollBack
-You know you've played MC too much when you go outside and say, "Wow! Epic Texture Pack!"-Me
-It's been almost a year since I've been on Minecraft, after getting into a major four-wheeler wreck that pretty much put me out for the count for about 6 months due to surgery and other gruesome stuff my grades dropped into a hole so deep I'm not exactly positive I can get them out. Just call me Rai ok? My name is from a time when I was a Naruto/Bleach anime nut
I know this is kind of an old thread but it's the only one i know of. I have been running your program in the background for 10+ min and have yet to see any folders created on the desktop that contain the backups. I just have the exe located on my desktop and the little icon is flashing when running. What is the folder called? I wish i knew what i was doing wrong.
What if you could get:
Save 1, Save2.
Every 2.5 minutes it overwrites save one, then another 2.5 minutes save 2 so that if the world is corrupted and it still runs you can restore from a more recent save... because you dont wanna restore a corrupt file :biggrin.gif:
wow i really think that what you have made is just too awesome and honestly i think my game doesnt ever really crash BTW how did you get your game to crash honestly
By the way, there shouldn't be any corrupted worlds if you don't switch off your computer whilst minecraft is on. Also, don't fiddle with minecraft.jar too much or install unsafe mods (which can be full of viruses).
If your computer crashes, then an easy way to fix corrupted worlds (in Windows 7) is to go into .minecraft\saves, find the folder with the corrupted save, right click and go 'properties'. Then go into 'Previous versions'. Copy the right previous version onto the saves folder and delete the corrupted version. NOTE: This won't have the stuff you did from the last playing session when your computer crashed. It will only be up till your last save.
Rollback Post to RevisionRollBack
If you liked my post, be sure to vote it up! (Press the (+) at the bottom)
I took 5 minutes to write a small app that will backup the files that get corrupted while you play and in the background.
DOWNLOAD: http://www.mediafire.com/?k7o2dmo69qxb4py
What it does/How it works:
It finds your appdata folder (in case you have moved it)
Checks if minecraft is open. If false it loops at a cycle of two and a half minutes.
If true checks each world save (1-5) copying the session.lock, level.dat, and level.dat_old to a folder created on the desktop.
Once copying is completed. The app is set to wait two and a half minutes before it starts over.
It overwrites each time it copies so it wont make infinite appends, and each copying cycle is 2 and a half minutes so If minecraft crashes close it down before that time.
I might make it append a couple times late on but that's just extra code to type lol
If Minecraft crashes and your world disappears from the loading menu. Follow these quick steps to try and fix it.
1. Locate your world save (%appdata%\.minecraft\saves\world#
2. delete level.dat, and rename level.dat_OLD to level.dat
3. If that still doesn't work, open up Minecraft Level Data on the desktop
4. Select your world number, then copy and overwrite the session.lock, level.dat, level_old into your main World save file.
5. If it still doesn't want to work for you, repeat step 2.
6. Get those same three files from a previous full backup.
If all else fails, start your world back up on the same save slot (not recommended imo) and search for your buildings from your new spawn point.
** To close/stop it press "SHIFT + ESC", It should stop it, if not go into task manager and end the task Painfulleap's MC world data backup.exe. You can tell it's running by a blinking icon in the trask bar
THIS DOES NOT BACK UP CHUNK DATA. only the files which relate to player inventory, location, and other small things contained in session.lock, level.dat, and level.dat_old
"Typing URGENT in the subject line makes my brain mark it as spam. Please dont do it."
Save File Corrupt/Disappears?
That's too much effort lol, I'd need to make a gui or some way in to select which world to recover which is fine and all, but I'd rather not take extra time to make it nor do I want to have the possibility of it accidentally messing up and overwriting when it shouldn't :smile.gif: Right now it runs nicely in the background and the chances of your save getting corrupted is pretty small but when it does happen. The 30 seconds to manually replace the corrupted file yourself doesn't seem like much of an issue.
"Typing URGENT in the subject line makes my brain mark it as spam. Please dont do it."
Save File Corrupt/Disappears?
So far it seems to have worked for me, Took about a dozen times of crashing minecraft for a test world to get corrupted.
Used the backups and it worked perfectly. All items were restored (other than a few new ones) the player location is set wherever the backup was taken (of course :wink.gif: ) so you might be a dozen steps from where the game crashed.
"Typing URGENT in the subject line makes my brain mark it as spam. Please dont do it."
Save File Corrupt/Disappears?
When I get some time I'll update it. I'll probably make it append a dozen times or so because I don't want it to have any pop ups. I'm trying to get it to run in the background without any gui or settings needed just simply open and your good to go.... I guess I could change it so it infinitely appends as long as you guys remember to remove some of the old unneeded files. Probably have it backup every 5 minutes, 12 an hour? I don't know I'll think about it a bit. But i'm willing to take suggestions :wink.gif:
Also backing up the entire world save (including chunks) causes excessive lag when it copies and takes to long depending on the size of the worlds
"Typing URGENT in the subject line makes my brain mark it as spam. Please dont do it."
Save File Corrupt/Disappears?
Basically, it would mirror your entire save folder to some arbitrary place on your HD, then every minute or so, run through the files in MC's save folder, checking for any files that had been changed since last backup, and back them up to subfolders in the mirror built at each timestamp for which an update occured. Then have some sort of command line operation to rebuild a save based upon an arbitrary timestamp you pass in that you could copy back in place of a corrupted save. This would, at least in theory, give you access to any arbitrary historical point in your save without the overhead of copying your entire pile of save data at every traul (so it would suck less HDD and not cause out of synch errors from trying to copy the entire save folder and having things changed in the middle). I know it wouldn't be bullet proof, but since it would be versioned, you could easily step back if you had a particular backup that was bad. Of course it could also clean up after itself and delete data older than 5 or 10 versions ago or something so it wouldn't slowly eat your entire HDD...
I was thinking of making an entire world saver that automatically backed up when minecraft was closed. Wouldn't be too hard something like if window open>Minecraft* check every 5 minutes, once found start looping a new if window open>minecraft* every 5 minutes and when it comes back false create an entire backup of saves based on modified date Then go back to start. maybe not individual chunks based on when they were updated but the whole save even add it to compressed zip or rar. have it delete old backups after a successful new backup and rename it.
anyways I still need to figure out a new way to backup files which have a tendency of corruption and at the same time only backup the good ones and not accidentally overwrite with corrupted ones. All the while having no way to tell if a file is corrupt or not
"Typing URGENT in the subject line makes my brain mark it as spam. Please dont do it."
Save File Corrupt/Disappears?
BTW, thanks for the tips, got my world back :smile.gif:
Upload it to virus total for proof it's clean :smile.gif:
Anyways It's outdated I no longer have the source code (not that it was hard to make) but this current version ONLY works for worlds 1 - 5. With the new ability to have unlimited worlds and change name to anything this will not work for those. If you use one of the original 5, I would recommend using this. It's saved me a few times.
The main features of this is it checks every few minutes if minecraft is running. If it is it starts a new countdown of a few minutes when the timer runs out, it copies the level.dat and what not from the 5 world save folders then pastes it in a folder on the desktop and starts the loop again. If minecraft is not found to be running the program goes into a separate loop of checking every 5 or 10 minutes for minecraft to start running. Not sure how any of that could get detected as a virus XD
I might consider creating a new one when I get some time.
"Typing URGENT in the subject line makes my brain mark it as spam. Please dont do it."
Save File Corrupt/Disappears?
For you
-It's been almost a year since I've been on Minecraft, after getting into a major four-wheeler wreck that pretty much put me out for the count for about 6 months due to surgery and other gruesome stuff my grades dropped into a hole so deep I'm not exactly positive I can get them out. Just call me Rai ok? My name is from a time when I was a Naruto/Bleach anime nut
Click these eggs. Or I'll find you.
<----Magma Dragon, u jelly? yeah, u jelly
Save 1, Save2.
Every 2.5 minutes it overwrites save one, then another 2.5 minutes save 2 so that if the world is corrupted and it still runs you can restore from a more recent save... because you dont wanna restore a corrupt file :biggrin.gif:
If your computer crashes, then an easy way to fix corrupted worlds (in Windows 7) is to go into .minecraft\saves, find the folder with the corrupted save, right click and go 'properties'. Then go into 'Previous versions'. Copy the right previous version onto the saves folder and delete the corrupted version. NOTE: This won't have the stuff you did from the last playing session when your computer crashed. It will only be up till your last save.