After many time of abscense I'm back to continue providing you with more information that can be valuable or useful, this time for SharePoint 2010 beginners that would like to know the new OOB Backup/Restore features and how to schedule backups using Windows scheduled tasks.
First we need to know and understand SharePoint Central Administration site options
As we can see on the image above we have 2 categories "Farm Backup and Restore" & "Granular Backup".
Here we have granular backup options now. SharePoint 2010 includes export/import options that was only available through stsadm in MOSS 2007, in order SharePoint administrator can execute a backup of a site, list or document library without PowerShell:
3. Finally a shortcut to review the status of the granular backup
Using Windows Scheduled Tasks
Having scheduled backups are fundamental for SharePoint adminsitrators, most of the times this taks are executed overnight, first of all, to grant data integrity and get the last updated data ,and then to minimize performance impact because of the heavy I/O on disks
In this section you will find some examples with the correct syntaxis for PowerShell scripts, but first we need to build a .BAT file like this one
SET SOURCE_SITE=<URL>SET DEST=<Path>
powershell -command <PS1 File> %SOURCE_SITE% %DEST%echo “Backup completed successfully at %DEST%” on %DATE% %TIME% >> <LogFileCustom>
<URL> Will be the Site Collection to be backed up
<Path> Path for the backup file. Drive:\backupintranet\backupintranet.bak
<LogFileCustom> Log file(Optional) Drive:\backupintranet\backupLog.txt
<PS1 File> PowerShell script location Drive:\backupintranet\Bckptl.ps1
But, what's inside PS1 file?, we have many options. Before we need to understand that SharePoint Central Administration site only allows us to make backups of the entire farm or at web application level only, but not for a specific site collection or site, we need to highlight that SharePoint administrator will be able to restore SharePoint objects as fast as possible, rather than restoring the entire content inside the content database that can be 200 GB of size and taking hours to be restored.
Well PS1 file MUST start with the following line in order to start PowerShell
Add-PsSnapin Microsoft.SharePoint.PowerShell -erroraction SilentlyContinue
What we have for backups:
Backup-SPSite -Identity <Site collection name> -Path <backup file> [-Force] [-NoSiteLock] [-UseSqlSnapshot] [-Verbose] (http://technet.microsoft.com/en-us/library/ee748617.aspx)
Sites, Lists or Document Libraries
Export-SPWeb -Identity <Site URL> -Path <Path and file name> [-ItemUrl <URL of site, list, or library>] [-IncludeUserSecurity] [-IncludeVersions] [-NoFileCompression] [-GradualDelete] [-Verbose] (http://technet.microsoft.com/en-us/library/ee428301.aspx)
Backup-SPConfigurationDatabase -Directory <BackupFolder> -DatabaseServer <DatabaseServerName> -DatabaseName <DatabaseName> -DatabaseCredentials <WindowsPowerShellCredentialObject> [-Verbose] (http://technet.microsoft.com/en-us/library/ee428320.aspx)
This last option is a new feature in SharePoint 2010 that allows SharePoint administrator to backup farm CONFIGURATION located in Configuration database, the objective is to restore some configuration settings in a different Configuration database like a DRP SharePoint farm (Disaster Recovery Plan)
If you want to know more backup/restore options and some PowerShell sample scripts for SharePoint 2010 you can check the following technet article:
See you soon...!!!