Ben Curry - CISSP, SharePoint Server MVP

All MindsharpBlogs

http://www.microsoft.com/mspress/books/10623.aspx

My Links

Archives

Image Galleries

Blog Stats

Favorite SharePoint Books

My Favorite Blogs

Scripts (.bat) I Promised at Dev Connections for Backup and Restore of SharePoint Server 2007

I promised three files to the attendees to backup your server farms and IIS metabase. Just copy each, change the names to protect the innocent (just kidding), and tweak for your environment. DISCLAIMER: Use these are your own risk. You should test everything in a test/dev farm before using on your production.

FULL_BACKUP.BAT - Use Control Panel - Scheduler to run once a week. Don't forget the 'Run As' account also needs write access to the backup location, in addition to the Central Admin app pool identity, and the SQL Server Machine account. This command will backup the entire farm to the following file share. Don't use drive:\directory format.

--Start--

"c:\program files\common files\microsoft shared\web server extensions\12\bin\stsadm.exe" -o backup -directory \\servername\backupshare -backupmethod full

--end--

 

DIFF_BACKUP.BAT - Use Control Panel -Scheduler to run when you want differential backups. Remember the same security as above, but also it will fail if you add a content DB or Web App since the last FULL backup.

--start--

"c:\program files\common files\microsoft shared\web server extensions\12\bin\stsadm.exe" -o backup -directory \\servername\sharename -backupmethod differential

--end--

IIS_MetaBase_Backup.BAT - This is used to backup your IIS Configs to each IIS server, in their respective 'metaback' directories. Just add an additional line for each server you want to backup. It will create a backup of the metabase called 'WeeklyBackup' with a version appended. The password doesn't matter, it just makes the backup portable.

--start--

cscript.exe %systemroot%\system32\iisback.vbs /s servername /u domain\username  /p userpassword /backup /b WeeklyBackup /v NEXT_VERSION /e password

cscript.exe %systemroot%\system32\iisback.vbs /s servername2 /u domain\username  /p userpassword /backup /b WeeklyBackup /v NEXT_VERSION /e password

cscript.exe %systemroot%\system32\iisback.vbs /s servername3 /u domain\username  /p userpassword /backup /b WeeklyBackup /v NEXT_VERSION /e password

--end--

 

Cheers

-ben

posted on Friday, November 09, 2007 6:35 PM

Feedback

#  3/10/2008 9:05 PM wilgee

SharePoint Resources

# re: Scripts (.bat) I Promised at Dev Connections for Backup and Restore of SharePoint Server 2007 3/14/2008 5:35 PM Garrett

Nice. I have something similar implement only the names have been changed to protect the innocent. Yarr!!

# Scripts to backup and restore SharePoint 2007 | Alpesh Nakar Blogs on SharePoint, Microsoft and that's IT 5/10/2009 11:15 PM Pingback/TrackBack

Scripts to backup and restore SharePoint 2007 | Alpesh Nakar Blogs on SharePoint, Microsoft and that's IT


Comments on this post are closed.
Title  
Name  
Url
CAPTCHA
Protected by Clearscreen.SharpHIPEnter the code you see:
Comments