Friday, July 31, 2009

Renaming MOSS 2007 or Sharepoint Server

Many times there are situations when you have to rename a MOSS installation either in your virtual PC environment and also sometimes in production, although the production one is little uncommon but the point is a sharepoint developer at one point or other want’s to rename his sharepoint server.

Renaming the server simply will screw up all the settings inside the sharepoint as many places there are hardcoded references to the previous server which has to be remapped in order to run the MOSS server with the new server name.

Here in this article i will explain you the step by step process for renaming the MOSS server.There are few resources available on the net which helps you in achieving the same but it was hard for me to find a good resource, so i thought to pen it down so that it can help everyone using Sharepoint.

Steps:-

  1. Change Alternate Access Mappings
  2. Run stsadm for renaming the server.
  3. Rename the server physically on windows explorer.
  4. Reboot the server
  5. Update login credentials 
  6. Restart IIS
  7. Change identity references in IIS
  8. Reconfigure search index

1.Change Alternate Access Mappings

This is the first and foremost step to rename the Sharepoint server.Alternate access mappings can be found at Central Administration>Operations>Alternate Access Mappings

Click on the web application url and edit the url to have the new server name.This you have to do manually for every website.

 

2.Run stsadm for renaming the server.

You have to rename the server using stsadm before actually or physically renaming the sharepoint server.

The command to rename the server is

stsadm –o renameserver –newservername “[yournewservername]”   -oldservername “[youroldservername]“ ” and this is also shown in the figure below:-

stsadm can be found in “C:\ProgramFiles\Common Files\Microsoft Shared\web server extensions\12\bin\

Developers can set the path to be globally accessible for ease of using stsadm instead of navigating to the whole path.How to configure environment variables in order to get the stsadm available globally can be found here :- http://smallworkarounds.blogspot.com/2009/07/sharepoint-quick-tip-add-stsadmexe-to.html

3.Rename the server physically in the windows explorer

For this step just right click on the My Computer icon in the start menu and click on properties then on the Computer Name tab just click Change button and rename it to whatever new name you want to give to your sharepoint server installation.

4.Reboot the server

After following all the 3 steps mentioned above just reboot your sharepoint server.

5.Update Login Credentials

Updating credentials is must as sharepoint server is still mapped to the old username inside the domain and will thus cause problems.To update credentials we will again use stsadm.exe

stsadm –o updatefarmcredentials –userlogin “newservername\username” –password “yourpassword”

 

6.Restart IIS

IIS needs to be restarted in order to reflect the changes which we have just made in the above steps.

Remember to restart the IIS using iisreset/noforce from the command prompt.

7.Changing Identity references in IIS

After doing all these changes still sharepoint website’s application pools are mapped to the old username and servername which were used to install the Sharepoint inside the farm.So in order to get rid of this old server name we have to manually change the Identity references in the IIS.

Remember if the identity says “Predefined” and the value is set to Network Service then there is no need to play and touch those settings, let them be like that only.

 

 

But if the Identity is configurable then you have to replace the old servername with the new servername in the username section and if you want to change the password then you have to type the password and retype it to confirm and press ok

After this step almost everything is done you just have to configure search index to function properly.

8.Reconfigure Search Index

After renaming the sharepoint server the search index have to be reconfigured the best possible solution is to drop the search index and rebuild it.

After doing all these changes you may still find at some places where few links are referencing your old server name and clicking those links does nothing more then giving a blank page to user saying nothing exists on the server like that which he is asking for.

In such scenarios you have to use your hit and trial method and have to find the root element which is causing this trouble and definitely that would be configurable just you have to figure out which is the right spot to configure this.

After doing this you might face problems with MySite which can be fixed once editing the People & Groups section of the MySite administration.

At last you can navigate through various pages to check that whether your MOSS 2007 server is working or not.

Disclaimer :- This article is based on my testing under my virtual environment things may vary and i advice not to test and play with your production farm sharepoint installations as this might damage your sharepoint server.

Happy Programming !!!!!!!!!!!!!!!!!!

6 comments :

Anonymous said...

I am a real Sharepoint newbie, so this was an invaluable guide.

I found that after changing the server name, I had to go into Shared Service Administration:SharedService1
(/ssp/admin/default.aspx)
and select
"My Site Settings"
to update the URLs there too.

Anonymous said...

nice post go ahead
thanks

Anonymous said...

Nice post. Will these steps work when the server is a part of a domain?

Usually, when multiple developers work on the same project, we set up a single DC with AD to which all the Dev-VMs are a part of. a seperat multi-server farm is setup for staging and QA. It is easier that way to test scenarios.

So If I have a new developer joining in the team and he/she needs to change a pre-setup VM within a domain, how can we do this? Any help in this regard will be appreciated.

Aashish said...

@Anonymous
"Nice post. Will these steps work when the server is a part of a domain?

Usually, when multiple developers work on the same project, we set up a single DC with AD to which all the Dev-VMs are a part of. a seperat multi-server farm is setup for staging and QA. It is easier that way to test scenarios.

So If I have a new developer joining in the team and he/she needs to change a pre-setup VM within a domain, how can we do this? Any help in this regard will be appreciated."

Yes these steps with work inside a domain controller environment with Active Directory as well.
In fact when i first created the solution i was inside the domain, anyways you have to be careful at some places if you are using the domain controllers and AD

harry said...

Hi,

This artical is very useful for me. I am a Share Point developer and always looking to

learn something new. I would like to introduce another good SharePoint blog, Have a look.

http://SharePointBank.com
Harry

Benabdallah Mohammed said...

Use it today Thanks realy useful
-- BMB

Post a Comment