To update the database connections by using Microsoft PowerShell
- Start the SharePoint Management Shell.
- At the PowerShell command prompt, type the following commands:
Copy
$db = Get-SPDatabase -Identity <guid>
Where <GUID> is the ID of the database that you move.
Note
Use Get-SPDatabase without parameters to see a list of all databases with GUIDs.Copy
$db.ChangeDatabaseInstance("<DBServerName>")
Where <DBServerName> is the name or alias of the new SQL Server or is the Always On Availability Group listener DNS name.Copy
$db.Update()
- If you use SQL Server database mirroring then you must remember to populate the FailoverServiceInstance property on the SharePoint database.
Copy
$db.failoverserviceinstance("<DBServerName>")
Where <DBServerName> is the name or alias of the mirrored SQL Server.Copy
$db.update()
- Repeat these steps for all databases that you move, including the Configuration and Central Administration Content databases.
Leave a Reply