Wednesday, March 11, 2009

Creating your SharePoint Development Environment

The SharePoint Development Environment is an all in one platform for the correct development and deployment of features.  It is designed to run on a development machine locally, package up all necessary code and deploy customisations to the Test and Production servers.

Setup of the Virtual Machine

Get a pre-built copy of the latest VM image from your server.  Copy both the VHD and VMC files to your D:\VMs directory.  Note: My  build contained Windows 2003 server with SQLServer 2000 and Visual Studio 2008, SharePoint MOSS Dev Tools and some site content and was about 18Gb in size therefore you should have at least 20Gb free.

Install the Virtual PC software onto your host machine by running setup.exe on the CD or Download from Microsoft.  When the software has been installed double click the Microsoft Virtual PC icon on your desktop.

image

Click “New” then “Next”

image

Select the “Add existing virtual machine” check box and click “Next”.  click “Browse” and select the location where the “SharePoint MOSS Dev Tools and Content.vmc” ws copied to on your local machine.  Then click “Next”.

image

Ensure that “When I click Finish, open Settings” is checked and click “Finish”.

image

Select Memory from the left had side and use the slider to set the amount allocated to the VM.  If you have 2Gb of RAM on the host set it to 1GB, if you have 4Gb of RAM set it to 2Gb, etc.

image

Select “Hard Disk 1” from the left had side and Click “Browse” on the right.  Select the “SharePoint MOSS Dev Tools and Content.vhd” file which you have stored on your local pc.

image

Select Shared folders” from the left had side and ensure that your Host PC’s D drive is mapped to the VM’s D drive.  We do this to ensure that SourceSafe and Visual Studio will operate correctly on the VM server.  Finally click OK and you should see that the Virtual machine has been added to your dialogue.

image

Select the SharePoint MOSS VM and click “Start”. 

Starting up and Configuring your of the Virtual Machine

Each VM needs to be configured for each developer to ensure that there is no IP Addressing or deployment issues that could conflict with correct operation.  Once the VM starts on your PC you should disable the network connection.

image

Right click the network icon (last on the right, next to the folder) and select Network Settings.

image

Select “Not Connected” from the drop down next to Adapter 1 and click “OK”.

Login to the VM using the local Administration account by holding down <Alt Gr> and clicking “Delete”, this is equivalent to sending <CTRL><ALT><DEL> on your VM. 

image

DUBWSDEV010 is the name of the original template used to create the VM, we will be changing this to match your VM name.  The Password can be obtained from your SharePoint Administrator.

When loaded you should be presented with a standard desktop.  Follow the instructions below to rename the MOSS installation.

image 

1) Go to the Sharepoint Central Administration > Operations > Services on Server  and stop all running services e.g. "Windows SharePoint Services Search", “Windows SharePoint Services Search “, etc.

image

Click Stop on anything started.

2) Double click the Newsid.exe icon.

image

Click Agree and Click Next.

image

Select Random SID and Click Next

image

Click “Rename the computer to:” and the new name of the development VM.  This should be in the format DUBWSDEV### where ### is a number from 010 to 019.  See the SharePoint Administrator for your assigned computer name and IP Address.  Click “Next”.

image

Be sure to uncheck the Automatically reboot when SID is applied box and click “Next”.

After some time processing the new SID should have been applied to your server.

image

Click “Finish”.

3) Now we need to rename your SQL Server installation.

Start Query Analyser from the “Start/Programs/Microsoft SQL Server” menu.

image

Set the SQL Server to be “.” and Connection to Windows authentication and click OK.

image

From the Query window type “EXEC sp_dropserver '<old server>'” and click the Play icon.

Next enter the command in the window “EXEC sp_addserver '<new_name>', 'local' “ and click the Play icon.

Exit Query Analyser.

4) From the command prompt type “stsadm -o renameserver -oldservername <old server name> -newservername <new server name>”

image

Type Exit and hit <Return> to close the command window.

5) Open the Registry using REGEDIT command and search for any occurrence of the old server name (i.e. DUBWSDEV010) rename each of these to the new server name (e.g. DUBWSDEV012).

Play close attention to the key located as “SOFTWARE\Microsoft\Shared Tools\Web Server Extensions\12.0\Secure\ConfigDB” this should be set to the new server name.

Restart the server and login as the local Administrator.

6) Reset the central configuration of sharepoint to the new server by using the administration command: “psconfig -cmd adminvs -provision -windowsauthprovider onlyusentlm”

7) Reset the external access mappings for the server using Central Administration/Operations/Alternate Access Mappings.

image

Edit each public URL in your site to match your new server name (e.g. DUBWSDEV012)

8) In My computer/Properties remove the server from the domain by clicking on Workgroup.

image

Enter “Workgroup” into the field and click OK and restart the server.

Change the IP address of the server to the one required.  Contact the SharePoint Administrator for your assigned number.

image

Click OK.

image

Re-enable the network card by right clicking the network icon (last on the right, next to the folder) and select Network Settings.

image

Select the Intel card that exists on your host PC and click OK.

 

Rejoin the domain under the new name by click on My Computer/Properties and select the Domain radio button and enter entirl.com into the field.

image

When prompted for a Username and password, this must be someone with enough permissions to allow this.

image

All going well you should see the following prompt.

Restart your server, you should now be able to have full access to the local SharePoint environment.