Link to home
Start Free TrialLog in
Avatar of rye004
rye004Flag 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.
Avatar of lcohan
Flag of Canada image

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:
Avatar of Neil Russell
Neil Russell
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of rye004


Icohan, I do not have the audit log files.
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."
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 "
Avatar of rye004


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


Thank you everyone for your input.  I ended up going with my second option in my list above.