“Help! We just had all our files and folders mysteriously disappear from our SharePoint site. They were there yesterday, and today they are all gone. We lost like 10,000+ files and folders.” This is the email I got from one of my clients the other day. If this sounds familiar, you might want to read this article.
- You have a disgruntled employee who went on a mass deletion spree
- You have an employee who deleted folders on a synchronized document library
It is usually the latter. Let me explain what is happening here.
When the user synchronizes a SharePoint Document library via OneDrive sync client, the whole library of files and folders is copied over to the user’s computer. But it is not just copied. A 2-way link is established between the user’s computer and SharePoint. Any changes in one place are instantly taking place in another (hey, that’s the whole purpose of sync). So if the user or someone else modifies something in SharePoint – the change is instantly replicated to the user’s synchronized files. It works the other way as well – if the user modifies a document by opening it up on the computer, the change instantly takes place in SharePoint as well. That’s just how it works!
Now, any changes mean any changes. So if the user deletes a file and folder in one place, it is instantly deleted in another. So what happens usually is that users sync document libraries, then decide to “clean up space” on their computer by simply deleting files and folders on the computer by pressing the delete button. Without any warning messages, files and folders are sent to the user’s Recycle Bin. So that is exactly what happened with my client – a user did just that, and 10,000+ department files and folders got deleted.
How to un-sync a SharePoint Document Library
So, how do we prevent this disaster? Very easy – you have to stop sync first and then delete your files and folders. Here is what you got to do:
- Click on a little blue cloud icon in your computer’s taskbar (that’s how you access OneDrive for Business on your computer)
- From the pop-up that appears, click on More
- From another pop-up that appears, choose Settings
- On the next screen, you will see a list of all the places you synchronize. Most likely you will see your own OneDrive being synchronized, plus any SharePoint document libraries you pressed sync on. To un-sync, just click on Stop Sync next to the location you want to stop synchronizing (in my case a Document Library on a Sales Site)
- You will then get a confirmation message; just press Stop Sync button
- The press OK – you are all set. You will see the green checkbox (that you normally see appear over the yellow folder) gone – meaning there is no more synchronization in place and no link between SharePoint document library and your computer. You can now press a delete button without fear of wiping out content from a SharePoint site :)
How to restore files and folders already deleted
If you read this post after someone deleted the files, you can do one of two things:
- Ask the user to go to their Recycle Bin and restore it themselves
- If you are a Site Collection Admin, you can restore on their behalf
I describe both options in this post.