Cloning SharePoint 2010 development images (for Hyper-V)

Before we begin, I´d like to point out the obvious: You want to clone a VM that is as clean as possible (without needing to install all the software on each clone of course). So clone your VM before creating any sites, since all references will be broken when you change the name.

This has been tested with a VM containing the following software:

  • Windows Server 2008 R2
  • SQL Server 2008 Express
  • SharePoint 2010 Enterprise
  • Visual Studio 2010 Premium
  • Office Professional Plus 2010

First, the best way to clone the VM for use in your Hyper-V setting. Contrary to what you might expect, this is not by using the export/import functions of Hyper-V Manager. This is actually meant for backup/restore.

The best way I have found is to just stop the VM you want to clone, copy the VHD, create a new VM definition and attach it to the copied VHD.

Next, the VM must be renamed. These steps are based on the MOSS 2007 cloning steps outlined here: http://www.sharepointdevwiki.com/display/public/Cloning+a+SharePoint+Virtual+Machine

  1. Stop the SharePoint Search services(s). I stopped both the “SharePoint Foundation Search V4″ and “SharePoint Server Search 14″ services to be sure.
  2. Go to System Properties and rename the VM, but don’t restart yet.
  3. Open “SQL Server Management Studio” and connect to “(local)”.
  4. Run the following query:
    EXEC sp_dropserver '<old_name>'
    GO
    EXEC sp_addserver '<new_name>', 'local'
    
  5. Run the “renameserver” stsadm command:
    stsadm -o renameserver -oldservername <old server name> -newservername <new server name>
    
  6. Now restart the VM.
  7. Rebuild Central Administration:
    psconfig -cmd adminvs -provision -port 12345 -windowsauthprovider onlyusentlm
    
  8. Restart IIS.
  9. Open Central Administration and delete the applications that are based on the old machine name.

Aaaand, you’re good to go.

This entry was posted in .NET and tagged . Bookmark the permalink.

One Response to Cloning SharePoint 2010 development images (for Hyper-V)

  1. Pingback: Tweets die vermelden Cloning SharePoint 2010 development images (for Hyper-V) | Mark's random .NET stuff -- Topsy.com

Leave a Reply

Your email address will not be published. Required fields are marked *

*

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>