Following article will show how to backup/restore SharePoint 2010 farms using shell script.
Power Shell Commands
Here are the shell commands that are used to backup/restore: Backup-SPFarm -Directory <BackupFolder> -BackupMethod {Full | Differential}
Restore-SPFarm -Directory <BackupFolder> -RestoreMethod Overwrite
Considerations and Prerequisites
First of all let’s start with little guidance about backup/restore procedures:
- By design to restore a database is required at least 1 Full backup and the rest can be only Incremental backups. In order to save space we can perform Full backups on weekly bases and Incremental on backups on daily bases. However for large databases incremental backups are recommended.
- Store a copy of backup files off-site
- Backups should not be performed during operation hours to prevent data loss
- Farm administrator account needed to perform the backup/restore operations
- Valid AD accounts required to be used for SharePoint service accounts. Otherwise after restore the farm will not be operational.
Backup procedure:
· Open SharePoint Management Shell and type the command
Backup-SPFarm -Directory <BackupFolder> -BackupMethod {Full | Differential}
Restore procedure
Open SharePoint Management Shell and type the command
Restore-SPFarm -Directory <BackupFolder> -RestoreMethod Overwrite
(command and parameters can be entered separately like below)
Then SharePoint will automatically list all Web Applications that are found in the backup:
Then SharePoint will ask user to provide credentials for the accounts that will be used to run the SharePoint Services. Depends on the installed services before the backup there are different accounts that needs to be provided. Few of the required accounts (listed as an example):
Restore-SPFarm -Directory <BackupFolder> -RestoreMethod Overwrite
(command and parameters can be entered separately like below)
Then SharePoint will automatically list all Web Applications that are found in the backup:
Then SharePoint will ask user to provide credentials for the accounts that will be used to run the SharePoint Services. Depends on the installed services before the backup there are different accounts that needs to be provided. Few of the required accounts (listed as an example):
- SP config account
- SP application pool account
- SP Search account
(below shown SP asking for Shared Services Application account)
- SP application pool account
- SP Search account
(below shown SP asking for Shared Services Application account)
Limitations of backup/restore
- You cannot restore a multiple-server farm to a single-server farm or a single-server farm to a multiple-server farm
- You cannot back up from one version of Microsoft SharePoint Server and restore to another version of SharePoint Server
- Configuration and Central Administration content databases are not being restored by design from Microsoft SharePoint Server 2010 tools. There are 2 options to move configuration databases (SP_Config):
o Manually restore using SQL Manager
o Install and configure SharePoint on the new environment, so it has its own configuration database and re-configure it. LDP ha only few custom configurations that needs attention – Shared Services Provider (SSP), Search configuration and schedule, AD connector
- Some of the service applications cannot be started automatically after the restore operation and needs to be started manually (Using Central Administration or Power Shell)
- Servers should have identical components installed! For example if you backup SharePoint farm with Enterprise Edition, Fast Search and BDC Connector configured, this backup cannot be restored on server with SharePoint Server Standard or Foundation or on server without Fast Search.
1 comment:
Dear sir,
does it backup all the related service that the web application used in the old server also?
Thank you.
Post a Comment