So I fired up Unity this morning as per usual and had some strange issues. The project I have been working on was not in the list of projects in my Unity 5.1 start up… I re-selected it whatever it started up fine.
Fast forward a few hours into my work session, I am noticing more and more stuff not working that I know for a fact I had working yesterday. I finally was frustrated and opened up the my scripts folder and it looks like nothing I worked on yesterday is here anymore… there were 3-4 huge things I made from the ground up yesterday and I am a pathological saver… they are all gone. Nowhere on either of my computers hard drives. All I have are versions of the scripts from 4 days ago missing all the stuff that I did yesterday.
Has this ever happened to anyone else? Should I have something else in place to combat this? Is there a simple fix? Currently I have my main HDD with all of my crap on it, then I have a back up drive that periodically I send all my stuff to, probably every few days. These files though, that I saved out probably 2 dozen times yesterday are all gone.
Usually a project only disappears off the project list if it is no longer there – it was moved, or perhaps it was on a removable drive, and it’s not inserted. Are you SURE you didn’t work on a copy in a different location or on a USB flash drive?
If that’s not the case, then I suggest you probably enormous amounts of corruption on your system.
make sure the code you updated was actually in your project folder. numerous times I have opened up unity, double clicked a script, and the actual script which is opened up is from inside a backup folder, not the actual project folder. This was due to the setting in monoDevelp and xamarin to “open up previous solution at start up”.
My scenes were all saved and all of the stuff I did on the editor was saved… just for some reason my new scripts were all gone, and the ones that I edited were rolled back. I believe this was caused by me rolling back Windows to a restore point. I found it odd that it only took out my .JS files but I was able to recover the erased work by simply doing it again.
In the mean time I coded up a nice little back up tool that I now run 24/7 and basically every 60 seconds it carbon copies my scripts folder to a spare internal hard drive, an external hard drive, a flash drive and a dropbox folder. So I don’t plan on losing code again… lol Some may say that is overkill… but I would prefer to not have a repeat episode.
So yea I think Windows Restore is what screwed me over, because I had saved a million times, just all script edits/new scripts after the date of the restore point I chose were gone.
Yeah, I had that same thing happen to me on a project a while back. I mostly use my Mac now, and Time Machine has saved my back several time. It’s not quite the same, but windows has something similar:
I’ve got a partition of two hard drives set up as a Raid 0 (mirrored) that I do all my work on. Then another pair of Raid 0 drives that I have the SVN set up on. So theoretically if I lose a hard drive in either place I can put in a new one and just keep going without losing anything. (Just make sure they’re software raids so if the motherboard goes out you don’t lose the RAIDs too).
Another benefit to source control is that after committing something, you can roll back to any previous version of any file(s) (or the whole project) that you want to. Sometimes if I feel adventurous and start mucking with code with some big new idea, I just commit the latest thing first, do my thing, and if it doesn’t work out I can just revert everything back. Very handy stuff.