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

12 Comments »

  1. MO Said,

    October 24, 2008@ 3:15 am      Reply

    Superb It work ….Thanks Man

  2. Scott Ellis Said,

    October 24, 2008@ 10:48 am      Reply

    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 http://www.aivea.com/sharepoint-training.htm

  3. Scott Ellis Said,

    November 7, 2008@ 9:01 am      Reply

    Thanks for this… helped with another deployment

  4. Peter Said,

    November 26, 2008@ 8:00 pm      Reply

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

  5. Jay C Said,

    October 5, 2009@ 2:15 pm      Reply

    much appreciated, this proved to be very helpful

  6. Phil S Said,

    October 26, 2009@ 7:32 pm      Reply

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

  7. laflour Said,

    October 26, 2009@ 9:05 pm      Reply

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

  8. denny Said,

    February 22, 2010@ 8:43 am      Reply

    Hi,
    thanks for your help!
    But when I write:
    “stsadm -o renameserver -oldservername -newservername ”
    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?

  9. laflour Said,

    February 22, 2010@ 8:51 am      Reply

    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

  10. denny Said,

    February 23, 2010@ 7:43 am      Reply

    >> 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! 🙂

  11. port Said,

    August 4, 2010@ 7:17 pm      Reply

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

  12. Michael Said,

    August 4, 2010@ 10:31 pm      Reply

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


RSS feed for comments on this post · TrackBack URI

Leave a Comment