Wednesday, December 7, 2011

Simple Concept: How to change database SQL server name in SharePoint

[Question]:

How do I change the SQL Server name in SharePoint 2010\2007?

[Answer]:

Golden rule: "User SQL Alias instead of the SQL server name"

In any case, whether you need replace the SQL instance name or SQL alias, you can do it:

For 2007: Make use of the stsadm command: stsadm -o renameserver

For 2010:  Make use of the PowerShell command: Rename-SPServer
You want to run the command on every server in the farm.

Real example:

I had the SQL alias soa-db01-prod, which it is not what I want now.
I want to replace SQL alias to soa-db05-prod.

Steps to successful SQL server name renaming on ever server that is included in the Farm (except SQL servers):
1. Add a new SQL alias "soa-db05-prod"
2. Run the command
Rename-SPServer –Identity "soa-db01-prod" –Name "soa-db05-prod"
3. Delete alias "soa-db01-prod"
4. iisreset


ATTENTION: I have discovered that after running Rename-SPServer 2 services still were referencing to the old SQL name:


1. User Profile Service Synchronization.
To fix it -  I have restarted the User Profile Synchronization Service
( to know more about  How to deal with User Profile Service - How to start User Profile Synchronization service)

2. Web Analytics Service Application
To fix it - I have stopped the services Web Analytics Data Processing Service,Web Analytics Web Service and re-created the service.