OneDrive for Business file restore troubleshooting for shared libraries: misses recent changes
🔍 WiseChecker

OneDrive for Business file restore troubleshooting for shared libraries: misses recent changes

When you use the OneDrive for Business file restore feature on a shared library, you may notice that recently changed files are not restored. This problem occurs because the file restore feature has a specific time window limitation for shared libraries that differs from the one applied to personal OneDrive libraries. This article explains why the restore window differs, how to verify which version of a file is available, and how to work around the missing recent changes.

Key Takeaways: Restoring Files in Shared Libraries

  • File restore time window: Shared libraries use a 30-day restore window by default, not the 93-day window available in personal OneDrive.
  • Version history check: Before using file restore, open the file version history to see if the missing recent change exists as a separate version.
  • Site collection admin > Site settings > Site collection features: Enable the “Document Library Folders” setting to improve version retention in some shared libraries.

ADVERTISEMENT

Why File Restore Misses Recent Changes in Shared Libraries

OneDrive for Business file restore works by rolling back all files in a library to a point in time within the last 30 days for shared libraries. For personal OneDrive libraries, the default restore window is 93 days. This difference is the primary reason recent changes appear missing after a restore.

The file restore feature does not restore individual file versions. It replaces the current state of every file in the library with the state of that file at the selected restore point. If a file was created or modified after the restore point, that version is lost unless it was saved as a separate version in version history.

Shared Library Restore Window Configuration

The restore window for a shared library is controlled by the site collection’s audit log retention setting. By default, SharePoint Online keeps audit logs for 180 days, but the file restore feature only looks at changes within the last 30 days. A tenant admin can increase the restore window up to 180 days using PowerShell, but this change applies to all site collections, not just one library.

Version History vs File Restore

Version history stores each save of a file as a separate version. File restore does not use version history. It uses the change log to determine which files existed at a given time. If a file was recently added and then restored, the file restore feature may not see it because the creation event falls outside the restore window.

Steps to Check and Recover Missing Recent Changes

Before running a file restore, verify that the missing recent change is actually stored in the file’s version history. If it is, you can recover it without affecting other files.

  1. Open the shared library in a web browser
    Navigate to the SharePoint site that hosts the shared library. Click the library name in the left navigation or open it from the site contents page.
  2. Select the file that has the missing recent change
    Hover over the file name and click the checkbox that appears on the left. Alternatively, click the file to open the preview pane.
  3. Open version history
    Click the file name again to open the details pane. Click the ellipsis (three dots) and select Version history. A panel opens showing all saved versions with timestamps.
  4. Check if the missing change appears as a version
    Look for a version with a timestamp that matches when you made the recent change. If you see it, click the down arrow next to that version and select Restore. This restores only that file to that version.
  5. If no version exists, use file restore with a custom date
    Go back to the shared library. Click the settings gear icon and select Library settings. Under Permissions and Management, click Restore this library. Select a date and time just before the missing change was made. Click Restore.

Increase the Restore Window Using PowerShell

  1. Connect to SharePoint Online PowerShell
    Open Windows PowerShell as an administrator. Run Connect-SPOService -Url https://yourtenant-admin.sharepoint.com and sign in with a SharePoint admin account.
  2. Check the current restore window
    Run Get-SPOTenant | fl RestoreDuration. The default value is 30 days for shared libraries.
  3. Set a longer restore window
    Run Set-SPOTenant -RestoreDuration 93 to set the window to 93 days. The maximum value is 180 days.

ADVERTISEMENT

If File Restore Still Misses Recent Changes

“The file was created after the restore point”

If the file was created after the restore point you selected, file restore will not bring it back. The only way to recover that file is to check the second-stage recycle bin. Open the shared library, click the settings gear, and select Site contents. Click Recycle bin at the bottom, then click Second-stage recycle bin. Look for the file there.

“File restore ran but some files are still missing”

If files are missing after a restore, check whether they were moved or renamed. File restore does not track file moves or renames. Use the site collection audit log to see if the file was moved. Go to Site settings > Site collection administration > Site collection audit settings and enable auditing for document library events. After enabling, wait 24 hours and run an audit log report.

“File restore is not available for this library”

File restore is only available for document libraries, not for lists, calendars, or other library types. If you see no restore option, confirm the library is a document library by going to Library settings > General settings > Title, description and navigation. The library type is listed there.

File Restore vs Version History: When to Use Each

Item File Restore Version History
Scope All files in the library at a point in time One file at a time
Retention window 30 days by default for shared libraries 500 major versions by default
Recovers deleted files Yes, if the file existed at the restore point No, only restores a previous version of an existing file
Affects other files Yes, all files revert to the restore point No, only the selected file is changed

Use version history when you need to recover a single file change. Use file restore when you need to undo accidental bulk deletions or ransomware activity across the entire library.

You now know why file restore misses recent changes in shared libraries and how to verify whether version history contains the lost data. Next time you run a restore, first check the file’s version history and confirm the restore window covers the time period you need. As an advanced tip, enable versioning limits on the library to keep up to 500 versions per file, which gives you a much larger safety net than the default 30-day restore window.

ADVERTISEMENT