OneDrive may keep deleting your files if your system’s hard disk has bad sectors or is failing. Moreover, outdated Windows and OneDrive client may also cause the error under discussion.
The user gets the information of the issue when he gets a message that he had deleted files from OneDrive or when he opens OneDrive and finds his files missing. The issue is reported on Windows PCs as well as on Mac systems. Both, i.e. Personal and Business/Office 365, versions of OneDrive are reported to be affected.
Although there are some instances on individual folders, a major blow was reported on shared folders. The severe damage was reported by the user where folders were present in the OneDrive client but files in the folders have vanished. Additionally, the issue is also reported by the users who were able to solve the issue priorly.
Before moving on with the solutions to stop OneDrive from deleting your files, make sure the date and time of your system are correct. Moreover, it is a good idea to avoid nested folders in OneDrive because some users reported that OneDrive was not able to handle the nested folders well. Furthermore, unlink your OneDrive from all PCs (during the troubleshooting process) except the problematic one.
Solution 1: Restore Your Deleted Files
The first step in the troubleshooting process should be to restore the deleted files. Follow the steps mentioned below to try to restore the files (this process can be a bit tedious):
- Backup the files present in your system’s OneDrive folder to someplace safe (but not in an OneDrive folder).
- Right-click on the OneDrive icon in your system’s tray and then click on Help and Settings (near the bottom of the menu shown).
- Then, select Settings and navigate to the Account tab.
- Now click on Unlink This PC and then confirm to unlink the PC from OneDrive.
- Repeat the same process on all other PCs where your OneDrive account was being used.
- Now, disconnect all your systems from the internet and exit the OneDrive application (even from the system’s tray) on all the linked systems.
- Open the recycle bin of your system and check if the OneDrive’s deleted files are there. If the files are not there, then open the OneDrive website and check its Recycle Bin for deleted files. If the deleted files belong to a shared folder, then check the recycle bin (system OneDrive folder and OneDrive web) of the owner of the folder for deleted files. If deleted files are not even there, then you may have to contact a data recovery specialist to recover your data (as soon as possible).
- If the files are present in the Recycle Bin of your system, then select those files and then right-click on them. Then click on Restore and check if the files are restored to your OneDrive folder (do not open the OneDrive application but use the File Explorer to open the OneDrive folder). It will be better to copy these files to a place other than OneDrive. If you cannot Restore the files from the Recycle Bin, then try to restore files one by one and if that does not solve the issue, you may have to rename the root OneDrive folder or you can restore (cut/paste) the files to another location.
- Then, launch a web browser (on another PC where your OneDrive account was not used) and open the OneDrive website.
- Then open the Recycle Bin of the website (in the left pane of the browser window) and check if the deleted files are present there. If the files are present there, then select the files and then click on Restore the files. If the status bar does not show progress, check if the files from the recycle bin are disappearing/restoring.
- Now compare the files between the affected system and web version (if possible). Keep in mind that folders may be present there but maybe empty inside; hence, open each & every folder and compare the files.
- Then download or backup the files that you want to keep (so you have all your required files/data on the new system).
- Now, delete the files from the OneDrive folder on the affected PC and OneDrive web (this is important because if the files are not deleted, then there can be multiple copies of the same file and it will be really difficult to sort out the data/files or you may have to delete tons of duplicates from OneDrive folder).
- Then upload your downloaded/backup files/ data to OneDrive web.
- Connect the affected system to the Internet and open the OneDrive application.
- Then login to the application with your credentials and hopefully, your files are restored successfully.
If you are encountering the file deletion issue with the Office 365 version of OneDrive, then you can use Files Restore to restore your files. But keep in mind it will not only restore the affected/deleted files but all other files, so, create a backup of the files you do not want to revert.
- Launch a web browser and navigate to the OneDrive website.
- Now login with the Office 365 credentials (or if already logged in, make sure you are using the correct account) and then click on the Gear/Settings icon.
- Now select Restore your OneDrive on the menu. If the said option is not shown, select Options and then select Restore your OneDrive.
- Now, click on the Verify Your Identity button and then follow the instructions to verify your identity.
- Then, on the Restore Page, select the date you want to revert to and then use the activity chart/feed to review the recent activities that you want to undo.
- Now, select the activities you want to revert, and then click on the Restore button.
- Then wait for the completion of the process and hopefully, your deleted files are restored./
Solution 2: Check Your System’s Hard Disk for Bad Sectors
You may encounter the error at hand if your hard disk (or SD card, in case of a phone) is failing or has bad sectors (because it may reject the changes and revert to the default file system). In this context, running the ChkDsk command may solve the problem.
- Run the ChkDsk command on your system.
- Now, check if OneDrive is operating fine.
Solution 3: Update Windows and OneDrive Client of Your System to the Latest Build
Windows and OneDrive are updated regularly to add new features and patch their known bugs. Your OneDrive may not function properly if you are using an outdated version of Windows or OneDrive client. In this scenario, updating Windows and OneDrive may solve the problem.
- Update the Windows version of your PC to the latest build.
- Then, press Windows + Q keys to open the Windows Search bar and search for Control Panel. Now, in the results pulled by the search, open Control Panel.
- Now, open Uninstall a Program (under Programs) and then select your OneDrive applicaiton.
- Then click on the Change button and in the How would you like to repair your Office programs window, select Online Repair.
- Now click on the Repair button and then in the Ready to start an Online Repair window, click on the Repair button to start the process.
- After updating the OneDrive client and Windows, check if the file deletion issue is resolved.
Solution 4: Create a New User Account
You may encounter the error under discussion if your user account is corrupt. In this case, creating another user account on your system and using that account to sync to OneDrive may solve the problem.
- Unlink all your PCs from OneDrive as discussed in solution 1 (steps 1 to 4).
- Create another local admin user account and launch OneDrive.
- Now, use your credentials to login OneDrive and then check if the file deletion issue is resolved.
Solution 5: Reset the OneDrive Client to Defaults
Your OneDrive client may delete the files if it has a corrupt installation. In this case, resetting it to the defaults may solve the problem. But keep in mind that the reset process may take a while according to the data to be synced.
- Open the OneDrive folder in the File Explorer and backup your data/files to someplace safe.
- Press the Windows + Q keys to open the Search bar and type Command Prompt. Now, right-click on the Command Prompt (in the results pulled by the Windows Search) and select Run as Administrator.
- Then, execute the following:
- If that command does not work, then execute the following:
C:\Program Files (x86)\Microsoft OneDrive\onedrive.exe /reset
- Now, wait for two minutes and during this, keep an eye on the OneDrive icon in the system tray. If the icon does not disappear and then appear, execute the following:
- Now wait for re-syncing of all the data/files and then check if OneDrive is working fine.
If the issue persists, then either perform a clean install of the Windows on your system or try to use OneDrive on another PC. If the issue is still there, then you may have to use NAS storage with remote access or another cloud storage service (Google Drive, Dropbox, etc.).