Monday, December 14, 2015

Restore SharePoint WebApplication from a different Farm

Hi Again! Long time, huh..
Every time I try to get a backup from SharePoint Farm and restore it to different farm I face a lot of problems, mainly in getting backup from SharePoint.. so better to get a Database backup.. but how to restore it in the other Farm!! ,, Perform the below steps then check the PowerShell script:

1- Back–up content database from the Source SP SQL server and restore it in Destination SP SQL Server.
2- Make Sure that the new Content DB has correct permissions (read & write).

#PowerShell Code start
Add-PSSnapin Microsoft.SharePoint.PowerShell

#Define your parameters
$DBServer= "SQLServer\SP"
$oldContentDB= "Old_ContentDB"

#Check the compatibility of the web application with the restored content database
Test-SPContentDatabase -Name $newContentDB -WebApplication $webAppName

#UnMount old content database from the web Application
Dismount-SPContentDatabase $oldContentDB

#Mount the restored content database and attach it to the web Application
Mount-SPContentDatabase $newContentDB -DatabaseServer $DBServer -WebApplication $webAppName


No comments:

Post a Comment