Thursday, September 24, 2009

How to Backup/Restore using STSADM command

The STSADM command is used for backing up and restoring site collections. You can use this command to take the backup with full functionality and restore to new site collection. The way to backup and restore a SharePoint site using this command is:

  • Stsadm –o backup –url -filename
  • And then at a later date you can restore the site using
  • Stsadm –o restore –url -filename

Backup a Site Collection:

  • On your SharePoint server hit WINDOWS + R.
  • Type “cmd” and click OK.
  • In the cmd window navigate to the “C:\Program files\common files\microsoft shared\web server extensions\12\bin” directory.
  • Type stsadm -o backup -url “http://Server001/demo” -filename “C:\MyFirstBackup.bak” -overwrite
  • Press Enter

When the backup is completed it will now be sitting in your C:\ with the name MyFirstBackup.bak.

At this point you can copy the file to the other server, or just perform the restore on the same server by following the steps below.

Note before restoring ensure that the target site collection you are restoring onto is a BLANK site. This will allow you to avoid some potential issues with duplicate names and ID’s.

Restore a Site Collection:

  • On your SharePoint server hit WINDOWS + R.
  • Type “cmd” and click OK.
  • In the cmd window navigate to the “C:\Program files\common files\microsoft shared\web server extensions\12\bin” directory.
  • Type stsadm -o restore -url “http://Server001/Newsite” -filename “C:\MyFirstBackup.bak” -overwrite
  • Press Enter

When the restore is complete the site collection should now be replicated, or restored.

Note: STSADM is not user friendly with error messages. Check the Application Event Log. The message received in the command window may not be indicative of the true problem.

Friday, September 4, 2009

Optimizing SharePoint search using Managed Properties

I would like to discuss about Optimizing SharePoint search using Managed Properties by configuring the Properties to appear in the Advanced Search. Here are the steps to create Managed Properties and configure it in MOSS 2007 Advanced Search.

1. Go to the central administration -> Shared Services



2. Under the Search Menu, click on Search Settings.

3. In the Configure Search Settings page, click on Metadata Property Mappings.



4. In the Metadata Property Mappings page, click on New Managed Property



5. Enter the Property Name and add the crawled properties that you want to add by clicking on the Add mappings button.


6. Click OK.

Once you have created the new custom managed property, go to the Advanced Search page.
1. Click on Site Settings and then on "Edit Page"
2. Click on Edit Menu of the Webpart and then Select "Modify Shared Web part"
In the Advanced Search Box Pane, click on the Properties Menu and then select the content in the Properties Text Box. In order that your Managed Properties appears in the Properties lists, you need to make changes in the XML file content.



The XML File in Properties has the following structure:
  • Find the string:
  • <PropertyDef Name="ModifiedBy" DataType="text"
    DisplayName="Last Modified By"/>
  • Add the following String below it:
    <PropertyDef Name="MyProperty" DataType="text" DisplayName="MyProperty"/>
  • MyProperty denotes the managed property that was created in Search Settings in the Shared Services.
  • Find the ResultType node:
    <ResultType DisplayName="All Results" Name="default">
  • Add the following string below this:
    <PropertyRef Name="MyProperty" />
  • Now you can click on Apply and OK to close the pane.

The property "MyProperty" will appear in the Property list box when All Results is selected.

Wednesday, September 2, 2009

SharePoint Maximum File Upload Size

SharePoint 2007 by default allows a maximum file size of 50MB that can be uploaded into any document library. This might be too much as you might not want users downloading 50MB files over your LAN/WAN. To change the maximum file size, here is the approach:

Increase the maximum upload size:
  • Click Start, point to All Programs, point to Administrative Tools, and then click SharePoint Central Administration.
  • Under Virtual Server Configuration, click Configure virtual server settings. On the Virtual Server List page, click the virtual server that you want to change.
  • On the Virtual Server Settings page, under Virtual Server Management, click Virtual server general settings.
  • Under Maximum upload size, type the maximum file size in megabytes that you want, and then click OK. You can specify a maximum file size up to 2,047 megabytes.

If you increase the file size limit, your site might occassionally time out for users while they are uploading files. To accomodate this increase the default time out property for IIS. Here are the steps to increase the connection time-out settings:

Increase the connection time-out setting

By default, the IIS connection time-out setting is 120 seconds. To increase the connection time-out setting, follow these steps:

  • Click Start, point to All Programs, point to Administrative Tools, and then click Internet Information Services (IIS) Manager.
  • Right-click the virtual server that you want to configure, and then click Properties.
  • Click the Web Site tab. Under Connections, type the number of seconds that you want in the Connection time-out box, and then click OK.