jamorlando
asked on
Export All Documents from Sharepoint
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
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
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Please check out this thread for further discussion on the topic:
https://www.experts-exchange.com/questions/26557366/List-all-Sharepoint-Document-Libraries.html
https://www.experts-exchange.com/questions/26557366/List-all-Sharepoint-Document-Libraries.html
ASKER
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_EXPOR T
set logFile=D:\SHAREPOINT_DOC_ EXPORT\Exp ort_Log.lo g
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=!sharepoint Site:~17,1 00!
set sharepointSite=!sharepoint Site:/=\!
set finalFolder=%backupFolder%
set finalFolder=!finalFolder!! sharepoint Site!
set finalFolder=!finalFolder:~ 0,-1!
D:\SPIEFolder\V3\SPIEFolde r.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.Assembl y]::LoadWi thPartialN ame(”Micro soft.Share Point”)
$siteurl = "http://sharepoint"
$mysite=new-object Microsoft.SharePoint.SPSit e($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
}
}
}
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
==========================
@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
set logFile=D:\SHAREPOINT_DOC_
mkdir %backUpFolder%
echo. >> %logFile%
echo.=====================
echo.%date% - %time% >> %logFile%
echo. >> %logFile%
echo.Generating DocLibList.txt >> %logFile%
powershell -command "& {D:\Backup\DocLibList.ps1}
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=!sharepoint
set sharepointSite=!sharepoint
set finalFolder=%backupFolder%
set finalFolder=!finalFolder!!
set finalFolder=!finalFolder:~
D:\SPIEFolder\V3\SPIEFolde
echo.=====================
echo. >> %logFile%
)
echo.Deleting DocLibList.txt >> %logFile%
del DocLibList.txt >> %logFile% 2>&1
echo. >> %logFile%
echo.%date% - %time% >> %logFile%
echo.=====================
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.Assembl
$siteurl = "http://sharepoint"
$mysite=new-object Microsoft.SharePoint.SPSit
foreach ($CurrentSite in $mysite.Allwebs)
{
foreach ($CurrentList in $CurrentSite.Lists)
{
if ($CurrentList.BaseTemplate
{
$OutputString = ($CurrentSite.Url + "*" + $CurrentList.Title)
$OutputString | Out-File "DocLibList.txt" -Append
}
}
}
ASKER
SPList looks interesting, but it's $800 ... no thanks.