Thursday, April 7, 2011

Steps to deploy a SharePoint 2010 site

The basic steps to deploy a SharePoint 2010 site are as follows;

  • Create Web Application
  • Deploy the content packages 
    •  (using a powershell script)
  • Edit the web.config file 
    • Located in the C:\inetpub\wwwroot\wss\VirtualDirectories\<web_application_folder>
  • Do the IIS-Binding
    • Go to Start -> Run -> IIS-Manager  and select the desired website from the list and click Bindings. Add the url of the site as a new binding. 
  • Enable features
    • This is only required if you are not restoring a backup of a site collection.
  • (Optional) 

Wednesday, April 6, 2011

Restoring a sitecollection backup in SP 2010

In SharePoint 2010 Management Shell you can enter the following command in order to restore a site collection backup in to a SharePoint 2010 we application.

Restore-SPSite -Identity -Path [-DatabaseServer ] [-DatabaseName ] [-HostHeader ] [-Force] [-GradualDelete] [-Verbose]



For example in order to restore a site collection to a certain web application we can use the following command.

PS C:\> Restore-SPSite -Identity http://cd-sgunasena -Path C:\UpdateFw\sitecollectionbackup\abc.bak -HostHeaderWebApplication http://abcdemo.abcompany.com -Force


Reference: MSDN

Monday, April 4, 2011

Using Host Headers

We can use host headers to host different sites in the same port. We can access them using different host names assigned to the same port address in the host file of the machine.
You can find the host file in the following location;
C:\Windows\System32\drivers\etc 
Open it using a notepad and add the host address and the desired host name you wish to use.

E.G.:   
# localhost name resolution is handled within DNS itself.
#    127.0.0.1       localhost
#    ::1             localhost

172.11.111.111    somesite.abcompany.com

Before deploying SP 2010 sites in powershell

I recently joined a release engineering management group for our SharePoint developments in the work place. And I'm now learning deployment related stuff.

Some quick facts:
  • Be sure to be logged in as a farm administrator (I get this confused sometimes as we meddle with a lot of test accounts in order to test SharePoint developments)
  • Make sure the DisableLoopback feature is enabled. You can do this by going to  Registry editor by typing regedit in start menu -> run. In registry goto HKEY_LOCAL_MACHINE -> SYSTEM -> CurrentControlSet -> Control ->Lsa . Right Click on Lsa and select AddNewDWord (32bit) Value and enter "DisableLoopbackCheck" as the name and enter 1 when prompted to enter a value. 
Keep in mind to make sure the following services are enabled and started before running windows powershell to deploy SharePoint 2010 sites.
  • SharePoint 2010 Administration
  • SharePoint 2010 Timer
  • World Wide Web Publishing service