Business Productivity and Information Architecture

Renaming server PC with Sharepoint

Usually all Sharepoint development happens on virtual environment. There are several advantages of this, like

  • creating snapshots of your system to mitigate system restore when you broke your environment
  • creating Sharepoint farm on the single PC, when you can easily run different virtual systems and setup sharepoint farm there

But when you are cloning your existed sharepoint system you end up with absolutely the same sever, including the same server name name. And this is the only problem. However, renaming server name with the installed Sharepoint is not trivial as you could expect.

There are several items which should be renamed - server name, database name, Sharepoint references. And the situation became complex when your Sharepoint sites use Sharepoint Search - in this case you need rename MSSQL$MICROSOFT##SSEE database.

Actually, I failed with renaming Sharepoint Search DB, and decided to turn search off before system renaming.

The follow steps should be done to rename server with installed Sharepoint

  1. Go to the Sharepoint Central Administration > Operations > Services on Server  and stop "Windows SharePoint Services Search"
  2. To go the Control Panel -> System and rename your server (save your old name somewhere). Don't restart your system
  3. If you have MS SQL Server installed on the same box you need to rename in too - go to "SQL Server Management Studio" and execute the following script

    EXEC sp_dropserver '<old_name>'
    GO
    EXEC sp_addserver '<new_name>', 'local'
    GO

  4. Update Sharepoint references to the PC name calling the next command: stsadm -o renameserver -oldservername <old server name> -newservername <new server name>
  5. Restart your PC
  6. If you try to open Central Administration after restarting PC it will try to open the site with the old server name. You need to recreate your Central Administration site for the new server name calling the following command(any port address): psconfig -cmd adminvs -provision -port 1800 -windowsauthprovider "onlyusentlm"
  7. Now if you restart IIS and try to open your Central Admin site it will successfully open your site with new server name
  8. Go to the "Application Management" and remove Central Administration Web Site with old server name

That's all. Now you have the clone of your virtual server with the new server name.

Update: Guideline how to rename content database: http://blogs.technet.com/wbaer/archive/2008/06/16/renaming-content-databases.aspx

 

Mirror: Renaming server PC with Sharepoint

Comments

MO said:

Superb It work ....Thanks Man

# October 23, 2008 10:15 PM

Scott Ellis said:

Great, Many of my previous students did not know this. I have taught quite a few the same thing.

If any of the readers of this informative blog would like to learn more please visit us at www.aivea.com/sharepoint-training.htm

# October 24, 2008 5:48 AM

Scott Ellis said:

Thanks for this... helped with another deployment

# November 7, 2008 3:01 AM

Peter said:

Thank you, step 6 about correctly pointing the Central Administration the new name is what I had been missing.   I appreciate the help.

# November 26, 2008 2:00 PM

Jay C said:

much appreciated, this proved to be very helpful

# October 5, 2009 9:15 AM

Phil S said:

Have you had the experience where a Admin user has already renamed the Sharepoint server, and the proper way to remove it?

# October 26, 2009 2:32 PM

Michael said:

Can you please elaborate what you want to remove - Admin user or SharePoint Server?

# October 26, 2009 4:05 PM

denny said:

Hi,

thanks for your help!

But when I write:

"stsadm -o renameserver -oldservername <old server name> -newservername <new server name>"

I get such error:

Cannot insert duplicate key row in object 'dbo.TimerRunningJobs' with unique ind

ex 'IX_TimerRunningJobs_ServiceId_VirtualServerId_JobId_ServerName'.

The statement has been terminated.

What should I do?

# February 22, 2010 2:43 AM

Michael said:

I'd try "stsadm -o preparetomove" to prepare database for movement (should fix some issue)

and then I would try to detach and attach the contend database - when you do this SharePoint fix some DB errors as well

# February 22, 2010 2:51 AM

denny said:

>> Michail

Thanks, now it's allright!

I just clear some rows in table "TimerRunningJobs" in configuration database and then rename server works,

Thanks for help! :)

# February 23, 2010 1:43 AM

port said:

just curious which rows in that table did you clear?  havinga similar issue.  your help is appreciated.

# August 4, 2010 2:17 PM

Michael said:

not sure about the table, but your are using the stored procedure to drop/add server (admin content db)

# August 4, 2010 5:31 PM
Leave a Comment

(required) 

(required) 

(optional)
 

(required) 

If you can't read this number refresh your screen
Enter the numbers above: