[Estimated Reading Time: 5 minutes]

Not really a “Pascal” issue, but an important one never-the-less and one that for some curious reason is not receiving any significant coverage: Windows 10 deletes your OneDrive files (in the cloud).

The Backstory

This first happened to me over Christmas when I lost over 250GB of files, mostly media files – mp3, mp4 etc. Chatter among various forums at the time confirmed that I was not alone and there were various theories doing the rounds, mostly involving a half-baked attempt at copyright enforcement on the OneDrive backend, given that media files seemed to be most affected.

But this wouldn’t explain why – as well as almost all my media files (with some oddly selective deletions: entire albums in almost all cases, but a handful where just one or two tracks from a given album were deleted leaving the rest in place) – OneDrive had deleted all my Microsoft Word files.

I’m pretty sure I own the copyright on my own CV, for example.

Then there were the various screenshots, photos and other images I had created/taken as well as my back-up copies of ebook edition of O’Reilly titles I had purchased (supplied DRM’free by O’Reilly), for example. I suspect that media files were widely affected because a lot of people (like me) were using OneDrive to sync media collections across devices.

The deleted files were of course in the OneDrive “Recycle Bin”, but anyone that has used this (or tried to) knows that it is about as useful as a chocolate tea-pot. The imposed, sequential reverse chronological view and the woeful UX involved in anything more than a single page of deleted files makes organised recovery difficult at best. In my case things were made a thousand times worse by the fact that – before I had noticed the loss of my files – I had decided to move my Android SDK/NDK folders from OneDrive to DropBox.

I keep those SDK/NDK files in a sync’d drive so that When I run updates with the SDK/NDK managers, those updates propogate to all the devices that use those SDK/NDK files without having to update manually on each and every one. If you like, this is the peripheral involvement of “Pascal” in this post, since I use the Android SDK in connection with my RemObjects Elements Android development work. 🙂

The result was that the “most recently deleted” files in my OneDrive recycle bin were the 10’s of thousands of files in the SDK/NDK folders making recovery of anything prior to the (intentional) deletion of those a practical impossibility.

The Windows 10 Connection

I use OneDrive (and Dropbox and GoogleDrive) to sync files across a number of devices. A Wintel laptop, an Intel NUC running a Windows Plex Server, a 1st Gen Surface RT, an iMac and a MacBook Pro.

Everything had run smoothly for years until this occurred. My suspicions first fell on the Surface tablet as this had recently had to be sent to Microsoft for service and when returned (in factory original condition, requiring LOTS of updates to be applied) had been particularly troublesome to set up with OneDrive in the first place. But this proved unfounded.

I eventually traced to culprit to the Windows Plex Server. This too had previously been problem free… right up to the point that I installed Window 10.

To test this theory I disabled OneDrive on that system and installed a 3rd party OneDrive client which could be configured for one-way sync only (i.e. sync from the cloud to the device).

Everything ran smoothly for about a week with a small collection of files that I used to test the “infrastructure”. Happy that things seemed to be OK, I put a larger (but not huge) set of files up into OneDrive and suddenly this 3rd party client started reporting problems with synchronising certain files. When I checked those files via the OneDrive web interface, they were fine. They were also synced perfectly on all my other devices.

There was nothing wrong with those files.

So I disabled the 3rd party client and re-enabled OneDrive on that Windows 10 system.

Those exact “problem files” were then promptly deleted from the Cloud.

The Problem

It seems that the OneDrive has some fundamental problem when syncing with any Windows 10 client (hence the difficulty experienced even by the 3rd party client) which combines with a bug/feature in the Windows 10 OneDrive client itself which responds to those difficulties by deleting “difficult” files from cloud storage.

My Resolution

I set about removing OneDrive from that Windows 10 system completely (it cannot be removed entirely but with a bit of work it can be disabled to the point where it might as well not exist).

Since I was using OneDrive simply to sync media onto that device, I now use scripts to sync any required media by simply copying across my home LAN from a “master” copy to that device. My other devices continue to use OneDrive to reliably sync files, including media.

I no longer rely on OneDrive as a “backup” mechanism, only as a sync’ing tool. If it ever stuffs up again I have my own, separate master and backup copies of all my files.

Oops, I did It Again

This morning I woke up to find my OneDrive was again empty. Well, not quite. There was a single 180KB Word document that it had left. But ALL of my other sync’d content had gone.

So has this bug now found its way into other OneDrive clients ?

No. It’s still a Windows 10 issue.

Without thinking, I had recently “upgraded” my work laptop to Windows 10 when the company made an upgrade image available. I selectively sync some documents and my MP3 collection to that laptop (I like to listen to music while I work).

I had carelessly let the Windows 10 cat was out of the OneDrive bag once more.

Fortunately, thanks to the more limited way in which I now use OneDrive, I am able to simply “Restore All Items” from my OneDrive Recycle Bin. I may need to do a bit of tidy-up later, but that’s going to be less hassle than trying to selectively restore.

The interesting aspect of this latest occurrence is that the laptop involved was only selectively sync’ing a subset of folders from my OneDrive but the entire content of the OneDrive – with the exception of that one file – was deleted (that is, moved to the cloud Recycle Bin) including folders that were not being sync’ed to the Windows 10 client at all.

In hindsight, this was also how my Plex server was set up – with selective sync. My MacBook Pro also only selectively sync’s and has had no similar problem (other than as a “victim”), so if selective sync is involved it is only as a contributing factor, together with Windows 10.

The Take-Away

It probably goes without saying, but cloud storage is not a backup solution. Or at least, should be only a part of any backup strategy.

And even for less critical purposes, OneDrive should only be used in conjunction with any Windows 10 systems if you can accept that this will require constant oversight and that you may regularly need to intervene to keep your files where you want them.

2 thoughts on “Windows 10 OneDrive Bug – (It Will Delete Your Files)”

    1. Re MS Guidance. None that I am aware of. The issue has come up in various Windows/OneDrive forums but I don’t remember anyone else making the connection with Windows 10 in the way that my observations appeared to confirm. The silence on this (given the number of people seeing the problem) is deafening.

      If the project/library you were asking about was the ADO wrapper, this is already available from my delphi.libs repo on github:


      I don’t as yet have any test suites or demos covering the ADO classes but feel free to have a play and get in touch if you run into any difficulties. Be aware however that I am currently nearing the end of a major re-write of my RTL strings library and have adopted some new techniques in that implementation that I may apply to other areas in those Delphi.libs (which at the very least are also likely to be affected by the changes in the strings runtime when it is published). However, that should affect only the internals of those other libraries, at least initially, and they will be updated when I push the new strings code.

Comments are closed.