Monday 23 June 2014

SharePoint SPFarm Backup


Open Power shell and run below command, it will give error, if you don't added Microsoft.Sharepoint name space.
Now open Sharepoint 2010 Management powershell and run below commands.
Get-Help BackUp-SPFarm
Get-Help BackUp-SPFarm -Examples
You will get all backup commands..
Use below command to SPFarm backup
Backup-SPFarm -Directory D:\testt -BackupMethod full
So we can do back up using above command...but every week we can't run this command, we have to automate this..
So i am going to write a PS1 script
1.Open Notepad
add-pssnapin Microsoft.SharePoint.powershell
Backup-SPFarm -Directory D:\testt -BackupMethod full
2.Save Notepade with name as: spfarmbackup.ps1
3.Go to start-->search for Task Scheduler
4.You will get window
5.In the roght side Under Actions-->Click on Create Basic Task
6.You will get a window, enter name of the task: ex: Weekly SharePointFarm Backup
7.Click Next
8.In the Trigger-->Select Weekly-->Click Next
9.Select Day name
10.Actions: Start a program
11.Browse the PS1 file which we have created-->Click next
12. Check "Open the properties dialog for this task when i click finish"
13.U will get a prompt
14.Select Run whether user is logged on or not
15. Enter password
16.Click ok
17.Click on Task Scheduler Library, you can find u r task
18.Login to Central Admin
19.Click on Backup and restore
20 CLick on "View backup and restore history"
21. You can view Backup jobs...