Creating clones of SharePoint VPC images (renaming SharePoint instances)

I am sure that many of you use VPC images or similar for your development environments, and often the requirement will arise to create a new image based on an existing image – for a new developer or a new project or for a variety of other reasons. When developing with SharePoint 2007 (MOSS) and having this on your development environment, this can cause some serious headaches – mainly because you have to give the new image a new name (unless it is not on the same network) and as soon as you rename a SharePoint server it throws a hissy fit (as does SQL Server if this is also on  your development environment).

Anyway, I thought I’d share the steps that I go through when duplicated a SharePoint image (and these are pretty much the same steps as renaming an image should this be what you needed to do.

  1. Go to the Sharepoint Central Administration > Operations > Services on Server  and stop "Windows SharePoint Services Search"
  2. Rename your server, however wait until step 5 until you restart it
  3. If you have MS SQL Server installed, you will also need to rename this. Go to "SQL Server Management Studio" and execute the following script

    EXEC sp_dropserver ‘<old_name>’
    GO
    EXEC sp_addserver ‘<new_name>’, ‘local’

  4. Update SharePoint references of the new name by calling the script:
     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. To recreate your Central Administration site for the new server name, call the following command using a port number for the new location of central admin:
    psconfig -cmd adminvs -provision -port 12345 -windowsauthprovider onlyusentlm
  7. Restart IIS and try to open your Central Admin site. It should successfully open your site with new server name
  8. Go to the "Application Management" and remove websites that reference the old machine name
  9. If you already have a search index drop this, and rebuild it

Now you should have a nicely renamed machine. You may find you need to create your site collections for SSP and My Sites, but this shouldn’t be too hard.

UPDATE: Today I tried a different method of doing this which also works. I got the steps from a post on the SharePoint University site: http://www.sharepointblogs.com/mirjam/archive/2007/08/06/renaming-a-moss-server.aspx

Here are the steps:

  • Change each alternate access mapping for your MOSS/WSS deployment in Central Administration:
    • Open Central Administration, "Operations" Tab, "Alternate access mappings" link
    • Modify each mapping item to reflect your newly chosen server name
  • Use stsadm.exe to invoke the "renameserver" command option:
    • Open a command prompt window
    • cd "C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\BIN"
    • stsadm -o renameserver -newservername <newname> -oldservername <oldname>
  • Rename your Server via Change Name Operation in Windows Server 2003:
    • Start Menu | Control Panel | System, "Computer Name" tab, "Change" button.
    • Input your new server name
  • Reboot the server NOW.
  • After reboot, open command prompt
    • cd C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\BIN
    • stsadm -o updatefarmcredentials -userlogin <domainuser> -password <password>
    • iisreset /noforce
  • Check all application pool identities in IIS, update where the old machine name is still there.
  • If you already have a search index drop this, and rebuild it
  • This entry was posted in SharePoint. Bookmark the permalink.

    Leave a Reply

    Fill in your details below or click an icon to log in:

    WordPress.com Logo

    You are commenting using your WordPress.com account. Log Out / Change )

    Twitter picture

    You are commenting using your Twitter account. Log Out / Change )

    Facebook photo

    You are commenting using your Facebook account. Log Out / Change )

    Connecting to %s