Tuesday, February 21, 2012

SharePoint 2010 Search, Best Bets

Here i just want to explain about ‘best bets’ functionality in this post.

Best bets essentially allows you to inject your chosen content at the top of search queries for certain keywords. As an example on my test bed site when ever someone types ‘javier’ I want to return three key items at the top. These three items will be:
  1. link to my twitter feed link
  2. link to my technical blog techgrowingpains.com
  3. link to my Linkedin page
Now, this is an example, but you can use this in a variety of other situations. For example for your companies’ SharePoint search you can use a keyword like ‘payroll’ and have it return links to your payroll system, or information to your payroll submission forms.
Create a Search Center
To leverage best bets we must use a search center. That is pretty easy. A search center in essence is a  subsite of your site. Click on Site Actions->New Site->Search->Basic Search Center. Lets fill it our with the following information, and select create. Take a look at the more options button if you want to modify it from the default settings.

Great once you select create it puts into your search center. If we try and search for the term ‘javier’ we get results, but not our best bests. Lets navigate back to our parent site.
Creating Best Bets
From here lets go back to our site settings. Remember this is our parent site and not the new site setting for the search center we just created. click Site Actions->Site Collection Administration->Search keywords->Add Keyword. I want my key word to be ‘javier’ but as we can see you can fill in synonyms as you need them. Optionally, you can add some type of definition to appear with the keyword result. In this case I’ll use ‘javi’ my nickname as a synonym.

Now that your key word is set lets create the actual best bets. Click on ‘Add Best Bet’.

Enter your information, and click OK. Let repeat that cycle to enter in the all the best bests we want, and in the order we want. If you take a look at the rest of the edit key word screen you will notice other options to add a contact and publishing options. Press OK when completed.
Lets test it out. I’ll navigate to your search center subsite and enter in my new keyword ‘javier’.

Great! now we have best bet set up and returning the information we want for our users. Almost complete but still not quite there…
Completing the Configuration
Lets test the search from our parent site.

hmm… as we can see no best bets here. The key is the URL.
1
http://javierbarrera.com/sites/test/_layouts/OSSSearchResults.aspx?k=javier&cs=This%20Site&u=http://javierbarrera.com/sites/test
Compare that to a search with in our search center subsite with the same exact term.
1
http://javierbarrera.com/sites/test/SearchCenter/results.aspx?k=javier
we need to link our parent site search bar to default to the new search center subsite. In the parent site click on site actions-> site settings-> search setings. Select ‘Enable custom scopes’ and fill in the appropraite link to your subsite. In my case that was ‘/sites/test/searchcenter’. I do not like to use full URL hard links because this offers the maximum versatility, and SharePoint is smart enough to add the appropriate completed link. In addition I chose, ‘Do not show scopes dropdown, and default to target results page’ under ‘specify the dropdown mode for Search Boxes:’. We will go over custom scopes later. click OK.
Now if we type in ‘javier’ from the parent’s search box it will return the proper results WITH the best bets.

Fantastic! Now, remember best bets is not available to SharePoint Foundation, but you can get it SharePoint 2010 Search Server Express, SharePoint 2010 Standard, and SharePoint 2010 Enterprise.

How to define a new Best Bet Keyword in SharePoint 2007?

  1. From your site home page, click "Site Actions/Site Settings/Modify All Site Settings".
  2. Under Site Collection Administration, click "Search Keywords".
  3. On the Manage Keywords page, click "Add Keyword".
  4. On the Add Keyword page, click "Add Best Bet".
  5. On the Add Best Bet popup page, enter the Target URL, Title and Description of the best bet and click "OK".
  6. Back on the Add Keyword page, enter the Keyword Phrase, Synonyms (separated by a semi colon), Definition, Contact Person and Expiration Date and click "OK".
  7. The new keyword and best bet should now be listed.
  8. Testing by searching for "My Phrase" should yield the Best Bet. You can customize where Best Bets show up on the results page. In our example's case, it was set to be the first results in the list.
  9. A search for any of the synonyms should yield the same result.

Thursday, December 22, 2011

Configure BLOB cache for SharePoint 2010 web applications

SharePoint 2010 supports disk-based BLOB Cache that controls the caching for binary large objects. If you configure BLOB for frequently used images, audio files, video files, java script files, css files etc., the performance will be improved. BLOB cache needs to be enabled in the front end web server and once configured; the configured files will be retrieved from the database and stored in a directory under Front end web server. This reduces the network traffic/load on the database server.
You need to carefully decide whether or not to use the BLOB cache. You need to carefully decide what files need to be placed under BLOB cache. For e.g. placing documents under BLOB cache in a collaboration portal will give you negative effect as the documents will be authored by users frequently.
Consider the following points for configuring the BLOB cache.
For a publishing site for which most of the visitors are anonymous or where most of the files are static content, enable the BLOB cache for as many file types as possible.
For other sites that contain lots of media assets that are read-only, or where only a small percentage of the media assets are updated, enable the BLOB cache for media files only.
Be noted that you can have only one BLOB cache per web application. Each web front end server will have its own copy of BLOB cache. In load balancing scenarios, each web server will have its own copies and the files will be added to the blob cache individually by the front end server when it serve the file for the first time.
The BLOB cache needs to specify in the web.config for each web application. By default, the BLOB caching is disabled. Open the web.config for the web application that you need to configure the BLOB cache. Normally you find the following line in the web.config of the web application.
<BlobCache location="<location>" path="<files to be cached>" maxSize="10" enabled="true" />
Modify the following attributes
location – the path to the directory where the blob files stores in the disk.
path – specifies the condition for file names that will be included in the cache. By default SharePoint will include a regular expression that matches certain extensions. In most of the cases you just need to add/remove some extentions to the list.
maxSize – the maximum size for the cache expressed in GB, 10 GB is the default
enabled - specifies whether blob cache is enabled or not. True indicates enabled
e.g.
<BlobCache location="C:\BlobCache\14" path="\.(gif|jpg|jpeg|jpe|jfif|bmp|dib|tif|tiff|ico|png|wdp|hdp|css|js|asf|avi|flv|m4v|mov|mp3|mp4|mpeg|mpg|rm|rmvb|wma|wmv)$" maxSize="10" enabled="true" />
Flush output cache
In some situations, you need to flush the output cache. You can do this by using the following PowerShell commands
$webApp = Get-SPWebApplication "<http://your web application url>"
[Microsoft.SharePoint.Publishing.PublishingCache]::FlushBlobCache($webApp)

Wednesday, December 21, 2011

Target a Web Part to a specific audience

Web Parts in Microsoft Office SharePoint Server 2007 can be targeted to appear only to people who are members of a particular group or audience.
An audience can be identified by using a SharePoint group, a distribution list, a security group, or a global audience.
  1. On the Web page that contains the Web Part, on the Site Actions menu, click Edit Page.
  2. On the Web Part, click the Web Part menu Web Part Edit Menu, and then click Modify Shared Web Part.
  3. Under Advanced, enter one or more audience names in the Target Audiences box.
When the page is rendered, the Web Part appears only to the people who are members of the audiences that you specified.

SharePoint 2003 to MOSS 2007 Upgrade: Database migration

Database migration of all the three upgrade techniques, my favorite is database migration. Database migration can be defined as “Requires the server administrator to install the new version on a separate farm or separate hardware, and then manually migrate the databases into the new environment.”
Database Migration enables moving to new farm or new hardware while SharePoint Portal Server 2003 environment is available and is untouched by upgrade. Microsoft says that database migration is a “Complex process that requires many manual steps and a higher risk of error. Requires additional manual steps to retain original URLs for sites. Search scopes must be re-created and search settings must be reapplied. Requires new server farm, and twice the amount of SQL Server storage space”. My advise is don’t be afraid and do try.
These steps are done for upgrade from WSS2.0/SharePoint 2003 to WSS3.0/MOSS 2007 in a single form environment. For different architecture, you may need some more steps. The steps are under:
· Get ready your MOSS 2007 environment.
· Run PreScan on SharePoint Portal Server 2003.
· Set the content database of SharePoint Portal Server 2003 as read only.
· Take back up of content database of SharePoint Portal Server 2003.
· Restore back up on SQL Server attached with MOSS 2007.
· Create web application in MOSS 2007.
· Remove content database of the newly created web application in MOSS 2007.
· Attach restore database with the newly created web application in MOSS 2007.
And that’s itJ.
I am not going into the details of creating MOSS 2007 environment. We will start from the second step:
Run PreScan on SharePoint Portal Server 2003:
The first step is to run PreScan.exe. For details kindly visit the following blog:
Set the content database of SharePoint Portal Server 2003 as read only:
The content database of SharePoint Portal Server 2003 ends with 1_SITE like Abc1_SITE.
The steps for setting database as read only are:
1. In Microsoft® SQL Server™ Enterprise Manager, right-click the name of the database that you want to set to read-only, and then click Properties.
2. In the Properties dialog box, click the Options tab.
3. Under Access, select the Read-only check box, and then click OK.
For Server 2005
1. In Microsoft SQL Server Management Studio, right-click the name of the database that you want to set to read-only, and then click Properties.
2. In the left pane, click Options.
3. In the right pane, under Other options, under State, next to Database Read-Only, click the down arrow, and then select True.
Take back up of content database of SharePoint Portal Server 2003:
For details kindly visit the following blog:
Let the name of the back be “Portal_Site.bak”. Wait after this. The time of database backup depends upon the system power and database size.
Restore back up on SQL Server attached with MOSS 2007:
The first step in restoring database is to create a database in SQL Server 2005. Let the newly created database name is “Portal_Site_Restore”.
1. Expand Database “Portal_Site_Restore”, right-click the database you want to restore, point to Tasks, point to Restore, and then click Database. The Restore Database dialog box appears.
2. On the General page, the name of the restoring database appears in the To database list box.
3. In the To a point in time text box (if using SQL Server 2005 Enterprise Edition), retain the default (Most recent possible).
4. To specify the source and location of the backup sets to restore, click From device, and then specify the database backup path (in our case, it is “Portal_Site.bak”) in the list box.
5. In the Select the backup sets to restore grid, select the backup path.
6. From the options tab, select “overwrite existing database”.
7. Specify the paths for .ldf and .mdf in the options tab.
8. Click OK to start the restore process.
Wait after this. The time of restoring database depends upon the system power and database size.
Create web application in MOSS 2007
In the SharePoint Central Administration, move to “Application Management” and click on “Create or extend Web application” under “SharePoint Web Application Management”.
Again click on “Create Web application”. Set the settings according to your own needs (do check the name of the web application and content database. Let the name of the web application be “http://servername:1234” and the name of the content database be “WSS_Content_1234”) and click OK. Don’t create any site collection.
Remove content database of the newly created web application in MOSS 2007
We can do that using Central Administrator or stsadm utility. I will like to do that using stsadm. Central Administration is easy. You will be able to learn that if you know how to do it using stsadm.
The command for removing content database using stsadm is ‘deletecontentdb’. The description is as under:
stsadm.exe -o deletecontentdb
-url <URL name>
-databasename <database name>
[-databaseserver] <database server name>
Parameter name
Value
Required?
Description
url
A valid URL, such as http://serverame:1234
Yes
Specifies the Web application from which the content database will be detached.
databasename
A valid database name, such as “WSS_Content_1234”
Yes
Specifies the name of content database to be detached.
databaseserver
A valid database server, such as “SQLServer1″
No
Database server name to be detached.
A typical command will be like:
stsadm.exe -o deletecontentdb -databasename WSS_Content_1234 -url http://servername:1234
Attach restore database with the newly created web application in MOSS 2007
We can do that using Central Administrator or stsadm utility. I will like to do that using stsadm. Central Administration is easy. You will be able to learn that if you know how to do it using stsadm.
The command for removing content database using stsadm is ‘addcontentdb’. The description is as under:
stsadm.exe -o addcontentdb
-url <URL name>
-databasename <database name>
[-databaseserver <database server name>]
[-databaseuser <database username>]
[-databasepassword <database password>]
[-sitewarning <site warning count>]
[-sitemax <site max count>]
Parameter name
Value
Required?
Description
url
A valid URL
Yes
URL of
the Web
application
to which
the content
database is
being
added.
databasename
A valid
database name
Yes
Database
name.
databaseserver
A valid
database
server name
No
Database
server
name. The
default
server
is used
if a
value
not
provided.
databaseuser
A valid user
name in the
form “domain\login”
No
Account
used for
SQL authentication. Must be
used in
conjunction
with the
database
password parameter.
databasepassword
A valid
SQL
password
No
The database
password parameter should only
be used
where Windows authentication is not
implemented.
sitewarning
A valid
integer
number,
such as
10
No
Integer number
of site
collections allowed in
the content
database
prior to
generating
a warning
event in the
Windows event log.
sitemax
A valid
integer
number,
such as
10
No
Specifies
the maximum
number of site collections allowed in
the content
database.
A typical command will be like:
stsadm.exe -o addcontentdb -url http://servername:1234 –databasename Portal_Site_Restore
Wait after this command. The time of adding content database depends upon the system power and database size.
 

Monday, December 12, 2011

Diff between WFE,applicationserver,database server in Sharepoint

---------------------------------------------------------------------------------
WFE Role hosts sharepoint site and handle user requests,
Database Role hosts and manage Sharepoint databases,
Application Role can host some services like Excel, Forms ...etc

----------------------------------------------------------------------------------
WFE /Web Front end server serves the web sites to the users. These servers hosts the IIS applications and servers the pages.
Application Server is a server provisioned for serving applications like Infopath forms services, Excel services etc
Database server is the Server having Microsoft SQL server installed and holds the databases for sharepoint.

The Web Front end Server is the server that is hosting IIS and serves the websites.
An Application Server  has services on it, for example, like Excel services, Project server, etc..
A database server simply hosts the SharePoint core db's and the other Content databases.. It just has SQL Server installation on it.

So you have to install Sharepoint to WFE's and App. Servers.. You dont need to install Sharepoint to the database servers on your farms.

Microsoft SQL Server 2008 Reporting Services Add-in for Microsoft SharePoint Technologies

Microsoft SQL Server 2008 Reporting Services Add-in for Microsoft SharePoint Technologies

http://www.microsoft.com/download/en/details.aspx?id=9437

Microsoft SQL Server 2005 Reporting Services Add-in for Microsoft SharePoint Technologies

http://www.microsoft.com/download/en/details.aspx?displaylang=en&id=1848