SharePoint - working round restore a library link missing
Introduction
Have you ever encountered the frustrating situation where the Restore a library
link in SharePoint is missing or inconsistently available? This can be a significant issue when you need to restore a library urgently.
The Problem
Typically, you would expect to see the link ‘Restore This Library’ in the SharePoint interface: Restore library
However, in some cases, this link might be missing:
The Workaround
After some investigation, I discovered a workaround. When the link was available, I examined the URL and noticed the following parameter appended to it:
Forms/AllItems.aspx?p=18
Steps to Restore the Library
- Navigate to the Library: Go to the SharePoint library you want to restore.
- Append the URL: Manually append
Forms/AllItems.aspx?p=18
to the library’s URL. Append to URL - Complete the Restore: Use the parameters to complete the restore process.
Important Note
The restore process will recover the files and data but will not restore any deleted structural changes, such as deleted columns.
Network trace from Developer tools
I used the browser’s developer tools to capture a network trace. I discovered that the endpoint oneDrive.restoreToDate is called during the restore process.
Endpoint
`<siteUrl>/_api/v2.1/drives/b!xd3Nn369IEG5NL9nW3aFX3yuncW9SEFClre4HUu8Jcu5BJ4LFx1NS4AG9d5QbHz8/oneDrive.restoreToDate`
Request Payload
{ "restoreTo":"2024-09-13T23:00:00.000Z",
"mostRecentActivityId":"4Ga4NqjX3Ej3lpEMAAAAAA=="
}
This payload specifies the date and time to which the library should be restored, along with an activity ID that identifies the most recent activity to include in the restore.
Conclusion
While this workaround is not ideal, it can be a lifesaver when the Restore a library link is missing. By manually appending the necessary parameters to the URL, you can still access the restore functionality and recover your library.