Sunday, November 16, 2008

Create a webapplication in Sharepoint with multiple content databases

Sharepoint allows you to create a Web application with multiple Content databases per site collection.
The only limitation here is that you can have one and only one content database per site collection for a web-application, so if you have 5 site collections in a web application, lets assume http://webspinnersinc as our web-application, we have the following 5 site collections
1. Home
2. HR
3. Finance
4. Marketing and
5. Purchase Department

So with the above structure in mind, you can have only one content database per site collection, so overall we can have 5 content databases for our web-application http://webspinnersinc

Since the concept is pretty clear now, we proceed to the how part, i mean Central administration never asks you to choose a content database or create a new content database, when you are actually creating a site collection, in-turn it analyzes the current database in use, which does not allow any control over the selection of content database, so what is the work-around? how do we accomplish this task? I got a fantastic solution from Michael Noel, from Network World, thanks Mike...
(Source - http://www.networkworld.com/community/node/19780)


------ Excerpts from his article ------

First create a Managed Path in SharePoint of /dept/ and then create site collections under the Managed Path, configuring those Site Collections to have their own Content Databases. So we want to have a separate content database for the site collection http://webspinnersinc/dept/HR
and a separate database for the site collection http://webspinnersinc/dept/Finance

There are two methods of getting around this. In the first method, the administrator goes to all Content Databases (SharePoint Central Admin – Application Management Tab – Content Databases) and takes the databases ‘offline’.
Note that simply taking the databases offline does not affect user functionality; it only disallows new Sites from being created in the specific Content Database. Once all Content Databases except for the one desired are taken offline, creating a new Site Collection will force that Site Collection to be created in the one you want.
If the databases aren’t created in advance, there is an even easier way to do this, by using the –createsiteinnewdb flag with the STSADM tool. The STSADM tool (located on web front-ends in the \program files\common files\microsoft shared\web server extensions\12\bin folder) is a fantastic administrative tool that performs a myriad of administration with SharePoint. In this case, it allows you to create a new Site Collection within a new Content Database. The following
Syntax illustrates one example:
stsadm -o createsiteinnewdb -url http://webspinnersinc/dept/hr -owneremail SharePoint@webspinnersinc.com -ownerlogin webspinnersinc\SPAdmin -sitetemplate sts -title “Human Resources” -databaseserver SERVER1 -databasename HR-Content-DB

In this example, a new site collection is created at the URL http://webspinnersinc/dept/hr The Site Collection Owner is set to webspinnersinc\SPAdmin and the Site Collection owner email is set to SharePoint@webspinnersinc.com. The default team site template is used to create the site (the template is simply named ‘sts’, without the quotes.) The database server is SERVER1 and the name of the content database created is HR-Content-DB.
Using this concept, you can construct a SharePoint environment that will scale quite nicely, as content is distributed across multiple databases. In addition, If you need to scale to multiple database servers, it simply involves moving content databases to the new server and updating the location in SharePoint


Saturday, November 15, 2008

Microsoft Sharepoint Downloads - MSDN

Here is a quick link for MSDN downloads available for Microsoft SharePoint 2007

http://technet.microsoft.com/en-us/library/cc262788.aspx

Back up and Restore your Site Collection in Sharepoint

You can use the tools included with Microsoft Office SharePoint Server 2007 to back up and restore your site collections. The Stsadm command line tool offers a fast and flexible, command line-based approach to content backup and recovery. You can use the Stsadm command-line tool together with Windows Scheduler to schedule delayed or periodic backups.

For more information about how the data protection tools included with Office SharePoint Server 2007 compare with other tools for protecting the SharePoint data, see Choose backup and recovery tools (Office SharePoint Server).

Important:

If changes are made to the site collection during the backup process, the backup can become corrupted. Backing up large site collections can take a long time. To reduce the chance that user activity will interfere with a site collection backup, or that the time that is required to back up large site collections will exceed the available maintenance window, follow these recommendations:

• For the duration of the backup, set the site collection URL to read-only by using the Setsitelock operation in the Stsadm command-line tool. This lets users view content on the site, but prevents activities such as adding or changing content that interfere with the backup process. When the backup is complete, return the access setting of the site collection URL to its default state.

• If the size of the site collection that you want to back up is 15 gigabytes (GB) or smaller, use the Stsadm command-line tool as shown in the procedures that follow.

• If the size of the site collection that you want to back up is from 15 GB through 100 GB, use Microsoft SQL Server 2005 or Microsoft System Center Data Protection Manager 2007 to perform a full backup of the site collection database.

• If the size of the site collection that you want to back up is larger than 100 GB, use System Center Data Protection Manager to perform a differential backup of the site collection database.

For more information about backup and recovery tools, see Choose backup and recovery tools (Office SharePoint Server).

Back up a site collection by using SharePoint built-in tools
Use this procedure to restrict access to the site collection during backup by using the Stsadm command-line tool.

Important:

Membership in the Administrators group on the local computer is the minimum required to complete this procedure. Limit access to the site collection during backup
1. At a command prompt on the drive on which SharePoint Products and Technologies is installed, change to the following directory: %COMMONPROGRAMFILES%\Microsoft shared\Web server extensions\12\Bin.

2. To determine the current access level of the site, type the following command, and then press ENTER: stsadm -o getsitelock -url <> where URL name is the URL of the site collection that you want to back up.

3. If the current access level allows changes to the site content, change it to read-only by typing the following command, and then pressing ENTER:
stsadm -o setsitelock -url
<> -lock readonly where URL name is the URL of the site collection that you want to back up.

4. When the backup is complete, reset your site collection lock from read-only to none
stsadm -o setsitelock -url <> -lock none

Use this procedure to back up a site collection by using the Stsadm command-line tool.

Important:
Membership in the Administrators group on the local computer is the minimum required to complete this procedure. To back up a site collection by using the Stsadm command-line tool 1. On the drive on which SharePoint Products and Technologies is installed, change to the following directory: %COMMONPROGRAMFILES%\Microsoft shared\Web server extensions\12\Bin.

2. Type the following command: stsadm -o backup -url
<> -filename <\\server. name\folder name\file name> [-overwrite] where URL name is the URL of the site collection that you want to back up, and where \\server name\folder name\file name is the UNC path of the backup folder and the name of the file that you are backing up to. If there is an existing file for the backup, use the -overwrite parameter to overwrite the existing file.

3. If the backup is completed successfully, the Command Prompt window displays the following text: Operation completed successfully.

4. If the backup is not completed successfully, the Command Prompt window provides additional details about the failure. Most typically, an incorrect URL or file name was given.

Use this procedure to restore a Web application by using the Stsadm command-line tool.

Important:
Membership in the Administrators group on the local computer is the minimum required to complete this procedure.
To restore a site collection by using the Stsadm command-line tool

1. On the drive where SharePoint Products and Technologies is installed, change to the following directory: %COMMONPROGRAMFILES%\Microsoft shared\Web server extensions\12\Bin.

2. To restore a site collection, type the following command, and then press Enter:
stsadm -o restore -url
<> -directory <\\server. name\folder name\file name> -restoremethod overwrite where URL name is the URL of the site collection that you want to restore and UNC path is the UNC path of the backup shared folder.

3. When you receive a warning that all selected items will be overwritten, type y, and then press Enter.

4. When prompted, type the user name and password for the Web application and content databases.

5. If the recovery is completed successfully, the Command Prompt window displays the following text:

Operation completed successfully.

6. If the recovery is not completed successfully, the command Prompt window provides additional details about the failure.

Most typically, an incorrect URL or file name was given.

It is not possible to schedule backups from the SharePoint Central Administration Web site. There is no operation that enables you to automate backups by using the Stsadm command-line tool.

You can, however, automate the process by creating a batch file and then using Task Scheduler in Windows Server 2003 to run the batch file at a specific time. Because performance can be affected when doing backups with the Office SharePoint Server 2007 built-in tools, you might want to schedule your backups for off-peak times such as at night or on weekends.


Use this procedure to create a batch file that will run a full backup of your site collection. This procedure assumes that you have already created a shared folder for your backups.

Tip: When using Task Scheduler, make sure that the system date and time on your computer are accurate. To verify or change this information, double-click the time indicator on the taskbar. To create a batch file

1. Click Start, and then click Run.
2. Type notepad, and then click OK.
3. In Notepad, type the following text:

Copy Code


@echo off
echo ===============================================================
echo Back up sites for the farm to C:\backup
echo ===============================================================
cd \Program Files\Common Files\Microsoft Shared\web server extensions\12\BIN
@echo off
stsadm -o backup -directory <\\server name\folder name> -backupmethod full -item 
echo completed
4. where \\server name\folder name is the UNC path of the backup folder and where Web application name is the name of the site collection that you want to back up. You might use the full farm path notation as displayed by the showtree parameter or the name of the component in the path if it has a unique name — for example, Windows SharePoint Services Web Application\SharePoint-80.
5. In Notepad, on the File menu, click Save As.
6. In the Save As box, select the folder where you want to keep your batch file.
7. Use the ".bat" file name extension; type the name of the file in the File name box, for example, backup_batch.bat.
8. In the Save as type box, click All files.
9. Click Save.

To schedule a backup
1. Start the Scheduled Task Wizard, and then click Next.

2. Click Browse, locate the batch file that you just created, and then click Open.

3. Type a name for your task, for example, backup_batch.

4. Select how often you want this task performed (for example, weekly), and then click Next.

5. To automatically perform this backup periodically, select an interval such as Weekly or Monthly. To perform this backup one time, or to delay a single backup, select One time only.
6. Choose a time and start date for your backup.
7. Type a name and password for a user, and then click Next. This task will run as if it were started by that user.
8. Click Finish.

To configure advanced settings for the task, select the Open advanced properties for this task when I click Finish check box in the final page of the wizard. This opens the properties dialog box for the task when you click Finish.

You can then change the program being run on the Task tab, fine-tune the schedule on the Schedule tab, customize settings on the Settings tab, or set user and group permissions on the Security tab.

Courtesy: MSDN

Sunday, September 28, 2008

How to install Sharepoint 40 application templates - Installation scripts

Here are a few simple steps to install Microsoft Sharepoint fantastic 40 application templates in a jiffy.


Installation Guidelines: (follow them in the order specified)
a) Install all the 40 application templates in your local hard-drive, lets say you install them in C:/MOSSTemplates directory
Note: Before installtion, please make sure your Windows SharePoint Services Administration service is running.

b) In order to install the set of 20  application templates having .stp as extension, create a batch file namely: STPInstallation.bat, create it in the same directory, where you have installed the application templates. 
Copy the following code inside this batch file:

for %%f in (*.stp) do "C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\BIN\stsadm.exe" -o addtemplate -filename %%f -title %%f

Run this batch file and your 20 application templates are installed without any effort.

c) In order to install the next set of 20  application templates having .wsp as extension, 
i) Create a batch file namely:  AddGACSolution.bat in the same directory
Copy the following code inside this batch file:

for %%f in (*.wsp) do "C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\BIN\stsadm.exe" -o addsolution -filename %%f

Run this batch file.

ii) Create another batch file namely:  GacDeployment.bat in the same directory
Copy the following code inside this batch file:

for %%f in (*.wsp) do "C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\BIN\stsadm.exe" -o deploysolution -allowgacdeployment -immediate -name %%f

Run this batch file to deploy the solution in the Global Assembly Cache and do an iisreset thereafter

d) You 're done installing the fantastic 40 application templates provided by sharepoint. Finally you get to see them all, when you create sites in sharepoint

If you find this post helpful, spread this to all the Sharepoint practioners you know...
In case you facwe any issue, post a comment on this blog and i will try to solve your issue...

Saturday, August 30, 2008

Top Sharepoint WSS/MOSS via RSS Feeds


A few must subscribe RSS feeds for SharePoint, i thought should share


#1. Sharepoint Blogs, all Posts
http://www.sharepointblogs.com/MainFeed.aspx?GroupID=3

#2. Sharepoint Blogs, posts by Sharepoint Experts
http://www.sharepointblogs.com/MainFeed.aspx?GroupID=2

#3. Microsoft official Sharepoint Blog
http://blogs.msdn.com/sharepoint/rss.xml

#4. Sharepoint University Forums WSS/MOSS v3 Setup/Admin/Deployment forum
http://www.sharepointu.com/backend2.asp?fid=75

#5. Sharepoint University Forums
http://www.sharepointu.com/backend2.asp?fid=76

#6. Andrew Connell [MVP]
http://feeds.feedburner.com/AndrewConnell

#7. Shane Perran's Blog [MVP]
great for the creative sharepoint developer/designer
http://feeds.feedburner.com/SharePointCustomizationBlog

#8. Andrew May's
http://blogs.msdn.com/andrew_may/rss.xml


#9. John Holliday
http://feeds2.feedburner.com/johnfholliday