Monday, June 27, 2011

Backing up sharepoint using powershell

One of the powerful scripting standards in a Windows Server 2008 R2 installation is powershell.(for prior versions of Windows Server you should manually download and install PowerShell 2click HERE




Powershell is used in different ways like for backing up sharepoint sites which are generally automated.
Here is a simple demo on how it backups entire sharepoint site:

1. Open a new text file and enter Backup-SPFarm -Directory D:Backup -BackupMethod full
2. Save the file as D:ScriptsSharePoint_Backup.ps1.  Note, that you may need to use “set-executionpolicy RemoteSigned” to allow for running of a local unsigned ps1 file.
3. Enter powershell -command E:ScriptsSharePoint_Backup.ps1 in the command line (or alternatively in a batch file).
4.Admin permissions for the account are mandatory in the task scheduler.For details on how to use the Task Scheduler see  HERE

While implementing SharePoint farm backups,SQL server gets instructed by sharepoint to perform database dump to our chosen location . so we need to overcome some issues to avoid complications regarding the backup task.
a. Both read and write accesses are required by the central admin app pool account to the backups location b. The SQL Server Service account will require both read and write access to the backups’ location. c. When implementing a farm backup using STSADM or PowerShell, the account running it will require both read and write access to the backups’ location
d. The location will need to be accessible from the SharePoint system the running the backup.
e. The location will need to be accessible from the SQL Server instance that SharePoint is attempting to back up. 

SPONSORS:

No comments:

Post a Comment