Export All Documents from Sharepoint

jamorlando
jamorlando used Ask the Experts™
on
Hi,
I was wondering if there was a way from Sharepoint 2007 to somehow export all documents (.doc, .xls...etc...) from the database or backup file.

Say someone overwrites or deletes a document by accident.  In theory, I need to restore my entire Sharepoint databases to retrieve the document that was deleted (from the web front end).

Just seems a lot quicker/easier if there was a way to extract the deleted file from an old database backup.

Thanks for your help,
Jamie
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Senior Technical Lead
Commented:
Try this tool...http://spiefolder.codeplex.com/  .. go to download option and download it.

Also try this one ..http://www.btsoftware.com/products/splistx.htm

Hopes help you.

Author

Commented:
Thanks, spiefolder seems to be really nifty and I noticed that it was recommended on some other boards as well.

SPList looks interesting, but it's $800 ... no thanks.

Author

Commented:
Please check out this thread for further discussion on the topic:
http://www.experts-exchange.com/OS/Microsoft_Operating_Systems/Server/MS-SharePoint/Q_26557366.html

Author

Commented:
I actually just finished writing a script (part powershell, part batch file) that uses the SPIEFolder utility.  It iterates a sharepoint site collection finds all document libraries and then runs the SPIEFolder utility for each document library.  Just tried it out and it works great.
I can't attach the code in a file, so I just pasted the code for both files below.
Enjoy (and use at your own risk)
You will need SPIEFolder too http://spiefolder.codeplex.com/ 


SHAREPOINT_DOCUMENT_EXPORT.bat

================================
@echo off
setlocal enabledelayedexpansion

REM Last editted by Jamie Orlando on 10/21/2010

REM ======================================================================================================
REM This script iterates through all the document libraries in Sharepoint and exports all documents
REM ======================================================================================================

set backUpFolder=D:\SHAREPOINT_DOC_EXPORT
set logFile=D:\SHAREPOINT_DOC_EXPORT\Export_Log.log

mkdir %backUpFolder%

echo. >> %logFile%
echo.============================== >> %logFile%
echo.%date% - %time% >> %logFile%
echo. >> %logFile%

echo.Generating DocLibList.txt >> %logFile%
powershell -command "& {D:\Backup\DocLibList.ps1}" >> %logFile% 2>&1
echo. >> %logFile%

for /f "tokens=1,2 delims=*" %%a in ('type DocLibList.txt') do (
   echo.%date% - %time%: Exporting %%a -- %%b >> %logFile%
   echo. >> %logFile%

   set sharepointSite=%%a/
   set sharepointSite=!sharepointSite:~17,100!
   set sharepointSite=!sharepointSite:/=\!
   set finalFolder=%backupFolder%
   set finalFolder=!finalFolder!!sharepointSite!
   set finalFolder=!finalFolder:~0,-1!

   D:\SPIEFolder\V3\SPIEFolder.exe "%%a" "%%b" "!finalFolder!" export >> %logFile% 2>&1
   echo.============================== >> %logFile%
   echo. >> %logFile%
)

echo.Deleting DocLibList.txt >> %logFile%
del DocLibList.txt >> %logFile% 2>&1
echo. >> %logFile%

echo.%date% - %time% >> %logFile%
echo.============================== >> %logFile%

DocLibList.ps1
==================================================
### Document Library Enumerate
###
### By: Jamie Orlando
### Modified: 10/21/2010
###
### Exports a list of Sharepoint sites and their document libraries to a text file


[void] [System.Reflection.Assembly]::LoadWithPartialName(”Microsoft.SharePoint”)
$siteurl = "http://sharepoint"
$mysite=new-object Microsoft.SharePoint.SPSite($siteurl)

foreach ($CurrentSite in $mysite.Allwebs)
{
   foreach ($CurrentList in $CurrentSite.Lists)
   {
      if ($CurrentList.BaseTemplate -eq "DocumentLibrary")
      {
         $OutputString = ($CurrentSite.Url + "*" + $CurrentList.Title)
         $OutputString | Out-File "DocLibList.txt" -Append
      }
   }
}




Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial