Saturday, December 4, 2010

Tips SharePoint

Following may be helpful while working with sharepoint:-

1. When you write new functionality for SharePoint 2010, the only good and maintainable way to deploy such functionality is as a SharePoint solution. A solution is simply a .cab file, renamed to a .wsp file. if you quickly want to check what are the items inside solution just simply rename a .wsp file to a .cab file and open it, you will most definitely see all the items & a manifest.xml file in there. The manifest.xml file is what SharePoint would use to understand what the solution contains.

2. Web Part inherits from the System.Web.UI.WebControls.WebParts.WebPart, which is a class that was introduced in .NET framework 2.0. There is also another .WebPart base class in the Microsoft.SharePoint namespace, but that is there only for backward compatibility reasons with WSS 2.0. If you're writing a WebPart today, you shouldn't inherit from that class.

3. If your SharePoint powershell commands are not running, you may need to load the SharePoint powershell snap in first. You can do so by executing this command on powershell:

Add-PSSnapin Microsoft.SharePoint.Powershell

4. If you need to install SharePoint Designer 2007 and SharePoint Designer 2010 on the same machine both of them will need to be 32 bit only. You cannot have 64 bit office 2010 and SharePoint Designer 2007 on the same machine. Personally speaking, I virtualize my work, so this is never an issue for me anyway. In short you cannot have 64 bit Office 2010, 64 bit SharePoint Designer 2010, and SharePoint Designer 2007 on the same machine. You can have them side by side in 32 bit versions.

Diffrent ways to backup & restore in sharepoint

While working with the sharepoint we come to the situation frequently when we need to take the back up of web site or site collection or site from sourec & restore it to destination. There are following way to acheive this:-

1. Backup & Restore Site Collection:-

This can be achieve from the sharepoint UI or from STSADM utility. For backup from sharepoint UI it can be done using central administration->operation->perform backup & for restore it can be done from central administration->operation->restore from backup. From STSADM following command can be used:-

To back up site collection, you may use the following command:

stsadm –o backup –url -filename

Similarly, to restore a backed up file to a site collection, you may use the following command:

stsadm –o restore –url -filename

2. Backup & Restore Site:-

For backup & restore of site following STSADM command can be used:-

To backup a single site, you may use the following command:

stsadm –o export –url -filename

In order to restore a single site at any URl, you may use the following command:

stsadm –o import –url filename

3. Backup & Restore Web Site :-

SharePoint stores its data in content databases. A single website can have a number of content databases, and a content database can contain one or more site collections.You can view all the content databases associated with a given web application under central administration-> Application Management ->Content Databases. From this you can add or remove content databases to a given web site.

I hope this basic information will help you to perform back up & restore operation in sharepoint. Enjoyeeeeee :)