Avatar of rye004
Flag for United States of America asked on

Looking for deleted files in SharePoint by using SQL backups.

I have a project where I have multiple SharePoint SQL databases from different points in time.  These different points in time are being retrieved from full SQL backups.  I am trying to determine if any documents were deleted between each backup.  This is in SharePoint 2010 RTM.

There are two methods that come to mind to accomplish this.  I wanted to get input regarding this.  If there is another method to do this, it would be great to hear.

1)      In the dbo.AllDocs table use the DirName and LeafName column to build the path of the file.  Once I have the path, I can do a comparison to see if it exists in the other databases.

2)      Use the Id column in the dbo.AllDocs table to uniquely identify files.  I am assuming this would be unique across all databases.  It would also help determine if a user deleted a document then try to put it back in place.

Any input would be greatly appreciated.
Microsoft SQL ServerMicrosoft SharePointSQL

Avatar of undefined
Last Comment

8/22/2022 - Mon

If you have the Audit Log reports already configured then you could use that  one to check for "Deleted and restored items" and many more - please see details at:


Neil Russell

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question

Icohan, I do not have the audit log files.
Neil Russell

Correction to my above post. Should say....

"Not to overstress the fact but if you are having to access the physical SQL tables then your SharePoint system is NOT set up optimally."
I started with Experts Exchange in 2004 and it's been a mainstay of my professional computing life since. It helped me launch a career as a programmer / Oracle data analyst
William Peck

In that case I think you could use the same script from link below to get the delta's - it is under "Ran the following SQL Script to review all files that had changed since 17th March against the mounted "


This is the last resort and a onetime deal.  Performance is not a concern.
Thank you for your comment.

Thank you everyone for your input.  I ended up going with my second option in my list above.
Get an unlimited membership to EE for less than $4 a week.
Unlimited question asking, solutions, articles and more.