Free SharePoint Backups (1 of 4)

SharePoint

I’ll be writing a series of 4 articles on how to backup SharePoint for free. In future articles we’ll discuss backing up different components you may need to perform a disaster recovery or a simple backup. These are “okay” backup solutions and definitely can’t compare to 3rd party backup solutions which I’ll touch on in the last article of this series.

First up: Backup all Site Collections

Backing up all Site Collections independently has saved me a lot of time. If a Site Owner or even a contributor deletes something important, I can go back to this copy. Its come in handy for those situations where the site just won’t load (web part problem or something else). With SharePoint 2007’s recycle bins, this has become less of an issue but at least for me, hasn’t done away completely for the need of individual Site backups.

This solution has 3 steps: A Windows Script, a batch file, and the task scheduler.

Step 1:

The Windows Script is created by Michael Noel and is part of his book, SharePoint 2007 Unleased. Todd Klindt has kindly hosted the script, it can be found here. I copied the code here for ease, just press down to expand.




 
  
    
************************************************************
SharePoint 2003/2007 Site Backup Tool
************************************************************
    
        
        
        
	    
    
Example:
cscript SPSiteBackup.wsf /path:"\\remoteserver\sharename"
cscript SPSiteBackup.wsf /path:"c:\sitebackups" /smtpserver:"smtpserver.companyabc.com" /report:"SPAdmin@companyabc.com"
    
  
  
 


Step 2:
Create a folder called “BackupBatch” on your data drive (D:\ in the example). Also create a folder on another drive (G:\ in the example) called “Backups”; create a batch file by copying and pasting the example below into notepad. Here’s a sample one that I have created and use. Remember to change your drive letters and file paths.

@ECHO OFF
ECHO ================================================
ECHO Backup Script For Office SharePoint Server 2007
ECHO        Written By: Wahid Saleemi
ECHO ================================================
REM ## Check for STSADM.EXE
D:
CD D:\BackupBatch
IF EXIST D:\BackupBatch\STSADM.EXE GOTO START
COPY "C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\BIN\STSADM.EXE" "D:\BackupBatch"
:START
REM ## Archive yesterday's backups; Delete 2 days prior
DEL /Q G:\Backups\Daily\Archive\*.DAT
MOVE /Y G:\Backups\Daily\*.DAT G:\Backups\Daily\Archive
REM ## Run the Backup for all WSS Sites
ECHO "Backup Started:" %date% %time% >> dailybackup.log
cscript SPSiteBackup.wsf /virt:"http://sharepoint.domain.com" /path:"G:\Backups\Daily" /smtpserver:"mailserver" /reportto:"PortalAdmin@domain.com"
ECHO "Backup Complete:" %date% %time% >> dailybackup.log

Step 3:
Finally, create a scheduled task that calls the batch file. I set mine to run using the farm service account at 1am everyday.

This post shows you how to create backup files for each Site Collection and store them on the server or to a file share. That file share can be backed up to tape or disk for archiving if you needed. Next up, I’ll show you how I use some of these same techniques to create Farm-level backups.

Series NavigationFree SharePoint Backups (2 of 4)
1 comment… add one

Leave a Reply