Skip to content


Clone SharePoint (MOSS / WSS) stand-alone developer virtual machine (Rename SharePoint Server)

I have often needed to copy a Windows SharePoint Services or Microsoft Office SharePoint Server developer Virtual machine.
I have gotten images from colleagues, or I needed to copy my own image.
I will assume your developer VM just uses the built-in SQL database (you installed SharePoint as standalone).
One company I worked for usually distributed Virtual Machines that did not have SharePoint installed on yet, but I would prefer just to have SharePoint installed and just rename the heck out of it.

The reason for this post is that, you can’t really just copy a VM and boot it up.
The SID and machine name of the virtual machine would be duplicate on the network and that is a bad idea.
This off course only happens if the copy and the original machine ever needs to be turned on at the same time.
If not then all these steps are not really needed and you can copy away.

Well basically what we need to do is rename the machine and also give it a new SID. Newsid.exe does both those steps.

Easy right? Well that is not all. SharePoint does NOT like it when you rename the machine, because of references that has been hardcoded into the system. You have to go through some steps before and after you do it.

I will go through these steps for you.

1: Clone machine
First off, copy the virtual machine (works sort of the same if it’s a physical one).

In virtual Server or VMware you should add the new VM, and make sure it does not have access to the LAN.
As long as you remove LAN access it does not really matter if the original machine is turned on when you follow these steps.

2: Alternate access mappings
Start the “Central Administration” -> “Operations” tab -> “Alternate Access Mappings” under “Global Configuration”
Click the link “Edit Public URLs”.
In the “Alternate Access Mapping Collection” drop-down, choose the first mapping.
Edit the URL to match the new machine name.
Click on “Edit Public URLs” again and repeat for rest of the mappings.

3: Tell SharePoint the Server has been renamed
We now tell SharePoint the server has a new name. It is done with STSADM which can be found in 12-hive in the BIN folder.

The command is:

stsadm -o renameserver -newservername YourNewServerName -oldservername YourOldServerName

4: Rename and give new SID
Note: If you never connect to a domain and run in pure stand-alone mode with your developer machine, you can just choose to rename the computer using Start Menu -> Control Panel -> System -> Computer Name -> Change

Now we can actually rename the server physically. We will also give it the new SID using newsid.exe.
It can be downloaded here (http://technet.microsoft.com/en-us/sysinternals/bb897418.aspx), and even though it states otherwise, it works fine with Vista, Windows 7 and Windows Server 2008.

Start the executable.
Agree to the EULA.
Press Next.
Make sure “Random SID” is selected and press next.
Click the check-box and enter the new name and click next.
The chosen settings will be repeated for you. Just go ahead.

It takes a little while. Once it’s done it will reboot and you have your new SID and machine name.

5: Update farm credentials
Open a command prompt and go to the 12\bin folder and type the following command:
stsadm -o updatefarmcredentials -userlogin “YourDomain\YourUserName” -password “YourPassword”

Then type this: IISRESET /noforce.

6: Application Pool identities

Now go to “Start” -> “Administrative tools” -> “Internet Information Services (IIS) manager”.

Windows Server 2008:
Expand the tree to reveal the application pools. Right-Click the application pools and choose “Advanced Settings”.
Under “Process Model” click the “…” button next to “Identity”.
If it is set to “Build-in” “Network Service” then skip it.
If it is set to a “custom account” click “Set” and update the user name with the correct machine-name if it is part of the user name.
Repeat for all App pools.

Windows Server 2003:
Expand the tree to reveal the application pools. Right-click the application pools and choose “Properties”.
Click the “Identity” tab.
If it is set to “Predefined – Network service” then skip it.
If it is set to “Configurable” update it with the new machine name if it is part of the user name.

Usually it’s only a couple of places you need to change this.

That’s pretty much it.
You may have to do a full search crawl to update the links.

If you are using MySites then you should go to Shared Services Administration in “Central Admin”.
Choose “My Site Settings” and rename references to the old server names.

  • Delicious
  • Digg
  • Twitter
  • Facebook
  • LinkedIn
  • TechNet
  • StumbleUpon
  • NewsVine
  • Technorati Favorites
  • Slashdot
  • MSDN
  • Share/Bookmark

Related posts:

  1. Quick intro to creating custom SharePoint (MOSS, WSS) site themes
  2. Enable Usage Analysis / Tracing / Reporting in SharePoint (MOSS)
  3. Error while starting WSS or MOSS Search: SPSearch(Administrator)
  4. Change from SharePoint Server name to Fully Qualified Domain Name (FQDN)
  5. Error when updating Windows SharePoint Services 3.0 with SP2 – An update conflict has occurred, and you must re-try this action. The object SPSearchDatabase…

Posted in SharePoint, Virtualization.


2 Responses

Stay in touch with the conversation, subscribe to the RSS feed for comments on this post.

  1. Seth says

    Good post. Definitely something I have been trying to accomplish. The only way I knew how to do it in the past was to create a VM, setup batch scripts to finish configuring SharePoint, then sysprep it. It’s a tedious process, and this gives another option for accomplishing the same thing if you didn’t build the VM yourself.

    I have one question. What about SQL Server? Don’t you have to drop the database scheme and re-add it once the server has been renamed? That was something I had to do on my sysprepped machine once the machine name was changed. Otherwise SQL would throw fits.

    • Code-Journey says

      Hi there

      Yeah sysprepping is definitely also an option. I only ever did a couple of syspreps years ago, so this route seemed more natural for me.

      About the SQL server. In my situation I used the build-in database, and nothing had to be done and I never had to the other times around either. Not sure if I ever renamed a VM with fullblown SQL server, but I don’t think it’s supposed to be any different that using the build-in actually.
      If I used a separate SQL database (on another server, and shared between copy server and original server), it would be a different matter. I did that when I “cloned” our production server to make a staging server.

      My first attempt was to use same database server, to save the extra SQL license.
      The steps for this was:
      - Clone machine
      - Rename, new sid
      - Copy databases
      - Offline production databases
      - Start up stage server
      - Detach production databases using STSADM
      - Add stage databases

      This did not work. I should have done this:
      Clone machine
      Rename, new sid
      Copy databases
      Offline production databases
      Start up stage server
      Run SharePoint Wizard and create new farm
      Create new SSP
      Create new web applications with content databases named something like DeleteMe and then go remove them and add the old ones.
      Something like that at least.

      Or even better
      Install a new machine from scratch.
      Install SharePoint
      Add all solutions
      Copy databases
      Offline production databases
      Start up stage server
      Run SharePoint Wizard and create new farm
      Create new SSP
      Create new web applications with content databases named something like DeleteMe and then go remove them and add the old ones.

      I also had major problems with the SharePoint WSS templates for IT manager, Financial Controller etc. that was used, and I did not want to reinstall those. They each use their own database, and it’s hardcoded. I didn’t feel like redoing that and installing them again.
      Oh and out backup had not used VSS so all the DLL files were not copied since they were in use when the backup started. How sad. But it made me figure out how to get files out of GAC which inspired a post or 2 :-)



Some HTML is OK

or, reply to this post via trackback.