Unity has deleted ALL my project content

Here’s what happened.

I had a previous version of Windows and my PC crashed.
So I bought a new PC, installed Windows 10 and the latest Unity.
I have a 4To NAS where I copied the whole content of my old Windows, it was:
**C:\Users\Olivier\Documents\Unity**

to my NAS, into that folder

Z:\Olivier\Windows - new install\Windows.old\Users\Olivier\Documents\Unity

I made sure that everything was there: I saw many files, likes all my prefabs with their clear names (“Bateau2cases.cs, and so on”), I couldn’t be wrong, I saw them.

From my brand new PC / Windows 10 / Unity ($2000 = this is not a small PC), I tried to open that project and here’s what Unity told me. Here’s just some of the lines:

A meta data file (.meta) exists but its asset ‘Assets/Code/Bateau.cs’ can’t be found. When moving or deleting files outside of Unity, please ensure that the corresponding .meta file is moved or deleted along with it.

That’s ok, but many lines later you can read:

Removing Assets/Code/Bateau.cs because the asset does not exist

AND THAT ASSET WAS EXISTING

Maybe Unity didn’t see it because it’s my NAS Under Linux ? If so:

  • why can I read everything from my Windows 10 ?
  • why did Unity manage to delete those files ?

This is just a burning shame.

And the big problem is that I’ve paid a formation from a guy, $300 / day, for 3 days. I’ll never see this guy anymore, and all my code is gone. I’ve lost $900 plus the work I did on my files.

NB: __I didn’t make a backup because I really didn’t think Unity could try do delete __other files than its own____.

I’ve never made in 25 years, a code that could delete a file that is not a part of the system I was writing. I dont understand how you could do such a work. At least ask the user if he does agree that you will try to delete those files. ASK THE USER FFS.

And on another side : if you know it’s risky to try to import a project why don’t you ask the user if he wants to make a backup before Unity tries to convert/import the project? A recursive copy of the folder named [project.bak]. Not hard is it? That would mean “this is a safe product to use”.

3241224–249172–Editor.log.7z (10.5 KB)

Invest in version control. Git Hub or similar things are free for small projects and have small costs for large project. I pay $6 a month to host 6 GBs of data for my games. This will also mean you can work across multiple machines and in the event a machine dies you know it’s safe on the server somewhere offsite.

I know this isn’t the answer you were looking for but if you use version control it will save you from this pain in the future.

I’m not complaining about the fact that I didn’t make backup: I’m complaining about the fact that what makes Unity is not acceptable (it’s not the same problem).

Just to give some input here, not officially from Unity but I am fairly certain what it has said is that the source file (i.e. the Assets/Code/Bateau.cs) did not exist in the right location, or Unity for whatever reason could not read it. It could however read the .meta file (Assets/Code/Bateau.cs.meta) which accompanied that file. Unity then deleted only the .meta file (which is fairly safe to be deleted, not so important), but it did NOT delete the source file (Bateau.cs) - it simply Removed the listing of it from its internal structuring (i.e. in the Library/ folder) so that it would not look for that file anymore. So Unity itself did not delete your files, it only deleted (if anything) the .meta files that Unity generates, which are relatively harmless to delete.

What may have happened is that somehow copying the project over to the NAS failed - and it only copied some of the files, e.g. just the .meta files. So you would have seen what looked like all of your project at a glance - the file “Bateau.cs.meta” looks a lot like “Bateau.cs” (especially on Windows if you are hiding the file extension, the meta file would be displayed as “Bateau.cs”). So somehow the files were not copied over to the NAS, and then when Unity tried to open the project it simply removed all the invalid .meta files because there was no source asset file to go with them.

@BFS-Kyle I suppose you’re right.

FYI I’m working 95% of the time on Linux. Fail-safe, and I can easily do backups without taking more space: small 20 lines script that renames my project “project.bak” and creates folders recursively and make symbolic links to the files. A symbolic link = 0 bytes, all the applications see it as an actual file, and if you delete it, you’re safe.

Why pay if you can have a better system, safer, that can make backups easily? Unity (and games that are not) are the only reason I reboot on Windows. (Satya Nadella knows that the future is coming more and more on Linux, that’s why he tries to make it run easily under Windows so the user wont leave Windows).

The Unity files were the only ones so far that I didn’t backup and I let them on the Windows disk.

Windows handles symlinks just fine (both hard and soft links). I use them all of the time. I even use them to move my Unity asset cache to a different hard drive.

You probably actually just copied the symlinks and never actually backed up the original files.

@Dustin-Horne “Windows handles symlinks just fine (both hard and soft links).”
Only since Vista, but you’re right, I’m sorry: Windows handles both hard and soft links. I’ll change what I say: “it took 20 years to make both hard and soft links work, and almost 40 years to be able to have a Windows that can work without graphic card (only command line)”. Tell me if I’m saying wrong things here again.
@Dustin-Horne “You probably actually just copied the symlinks.” => Impossible, I copied the whole “C” Drive.

What I’m 100% sure is that “Cleanmgr” is buggy, whether this is voluntary or not.

uhh…

If you’ve read carefully you’d noticed that I had paid for this but I’ve been given the Windows enterprise version of my ex-company so I didn’t have to click click click x 80 + copy SN to install Windows.
And if you think that a proprietary system that discovers it’s not a legal copy (my ex-company closed its doors 3 years ago) destroys everything it can is a good mentality, it’s not my point of view.
So, from every point of view but the games, I can’t say nowadays that Windows is better than Linux. This wasn’t the case a few years ago.

Your posts don’t make much sense. Unity didn’t delete any of your source files. The editor log was saying they weren’t there to begin with so it was cleaning up all their other references in your project structure. Recovering deleted files on an SSD is little different than in a standard hard drive, so I don’t know why you didn’t think you could retrieve them.

Cleanmgr would have only deleted your files with code extensions if you were storing them in one of the temp folders. It sounds like you had some other issue around the same time as running cleanmgr and are linking the two together when they are simply coincidental, especially since you claim to have lost system files as well.

Also, here’s the download link for the latest Linux version of the Unity editor
Unity on Linux: Release Notes and Known Issues page-2#post-3232675

Recovering files after “Cleanmgr”, on a SSD is almost impossible because of the way SSD drives store datas, and if it’s the drive of your system itself, you can remove the word “almost”, but it’s another subject.
“Cleanmgr” told me I has 2Tb of space to be freed. My SSD is only 256Gb. The problem has begun there. I shouldn’t have said “yes” because there was something suspect. Anyway I’ll remove all my offending comments, they’re useless. Nevertheless Windows has clearly deleted all those files. It was the only task running, and Crystal Disk Info, Smartmonotools, Hard Disk Sentinel and Intel Solid-State Drive Toolbox all told me this disk is healthy.

Thank you very much for the link I’ll try it tomorrow!

This is false, but whatever. Probably too late now anyway. Make backups in the future! :slight_smile:

Are your backups just copies of files on the same computer? If so I strongly advise you use a system like Git Hub so you have a backup that is offsite. Think about the reasons you might need a backup. Your house catches fire, an earthquake in your city, theft, there are a lot of scenarios that will result in you losing both your main project and backups if they are not stored offsite (preferably on a server somewhere in the internet with a provider that also backs-up your backup in multiple locations).

Version control also makes diff-ing versions of files in the history of your project a lot easier and allows you to recover form mistakes or simply try things out with the knowledge you can always revert back in seconds if your new ideas don’t pan out.

I’m sure you know all this but I thought I’d leave this as a message for other forum readers who may not realise the benifits of version control.

I have 4 backups:

  • one on my NAS which has 2 replicated HD
  • my NAS is rsync-ed to a PC at my web provider which is 400 km away from my home
  • I pay $10 more/month to have 30Gb saved every day (7 days rotation) to my web provider
  • I make copies of the main folder (= my own company information, all the lectures I give, and all my personnal + professional projects) into 2 different USB keys twice a month

As I’ve already told, Unity was for fun and it was the only folder that was on the Windows hard drive.
Now that it should become more important in a near future, I’ll save all my Unity projects on my NAS, of course.