Friday, 16 March 2012

Migrate a sharepoint website to another sharepoint server

The Following strategies are available in Sharepoint (Moss 2007) to migrate the Content.
I. Using SQL
II. Using STSADM BACKUP/RESTORE
III. Using STSADM EXPORT and IMPORT
IV. Using Content Migration API (SPIMPORT or SPEXPORT Classes )
V. Using Sharepoint Central Admin
VI. Using Sharepoint Designer

Please find the Explanation for each of these strategies.

USING SQL
            Using SQL, Backup the SQL Content Databases which are required and Restore them to a new databases in the SQL and attach these databases to the new application.
(Briefly we can say that take your content db ‘Offline’ using the Central admin. Take the content database offline in SQL Studio (Take Offline context menu item). Copy your database mdf and ldf files to the new machine (the destination machine). Attach the copies on the new SQL server using SQL Studio. Add the copied content DB to the Web Application on the new machine using the Central Admin on the new web server.)

STEPS:
1) Find the content Database
These are listed under Central Admin->Application Management->Site Collection List
2) Backup the content database
You could alternatively detach it, and copy it. Just doing a backup in SQL Server 2005 Management studio is easier.
3) Restore content database to new server
Copy the BAK file to new server. Create an empty DB in Management Studio, restore from backup, you may need to change an option in the “options” tab
of the restore dialog to get it to work. (Overwrite db).
4) Create Web App on new Server
Central Admin->Application Management->Create or extend Web App->Create New Web App.
5) Associate restored DB with new Web App
Central Admin->Application Management->
SharePoint Web Application Management->Content Databases->
Remove Content Database from your new web app.
Now use STSADM to add restored DB to this web app
c:\program files\common files\microsoft shared\web server extentions\12\bin on new server is where you can find the STSADM.
run this command from there.
stsadm -o addcontentdb -url http://yourwebapp:port -databasename yourcontentdb -databaseserver yoursqlserver
6) Run ISSRESET from command prompt.
MORE INFO on ATTACHING a Database and Detaching a Database
http://blogs.technet.com/corybu/archive/2007/06/01/detaching-databases-in-moss-2007-environments.aspx
http://blogs.msdn.com/sharepoint/archive/2007/04/13/stsadm-operations-published.aspx
http://blogs.technet.com/corybu/archive/2007/06/21/sharepoint-site-migration-and-balancing-growth.aspx
- External SQL Server Database Move Example
Database shipping
To migrate your content database from 1 SQL Server to another there are a few choices, your choice will depend on how much downtime you are willing to take.
First option being you can setup SQL Log shipping,
Stsadm –o preparetomove –contentdb SQLServerA:demo_content_1
Stsadm –o deletecontentdb –url http://demo –databasename demo_content_1 –databaseserver SQLServerA
At this point you would perform the final cutover on your shipped database to SQLServerB
Then finish with
Stsadm –o addcontentdb –url http://demo –databasename demo_content_1 –databaseserver SQLServerB
Copy Method(high impact)
Your other option would be to simply detach the database from SQL and copy the .mdf and .ldf to the new SQL server. While in transit your users will get a
generic “Cannot connect to content database” error when visiting their site. Following the copy you would perform the following on your web front end.
Stsadm –o preparetomove –contentdb SQLServerA:demo_content_1
Stsadm –o deletecontentdb –url http://demo –databasename demo_content_1 –databaseserver SQLServerA
Stsadm –o addcontentdb –url http://demo –databasename demo_content_1 –databaseserver SQLServerB
USING STSADM Backup/ Restore
Using STSADM BACKUP and RESTORE backup the complete WEB application and RESTORE it in the new Farm
When you back up by using the Stsadm command-line tool, you can back up individual aspects of your SharePoint Products and Technologies deployment. For example, you can back up an individual site collection or you can back up the entire farm.
To export sites from your SharePoint Products and Technologies deployment, you use the following Stsadm command.
Backup
Stsadm –o export –url <URL> -filename <FileName>.cmp
To back up a site collection, you must use the following stsadm command.
stsadm –o backup –url <URL of the site collection> -filename <Name of the backup file>
To back up an individual database, Web application, or the entire farm, you can use the following Stsadm command.
stsadm –o backup –directory <UNC path or local drive> -backupmethod <Full or Differential>
Restore
To import sites to your SharePoint Products and Technologies deployment, you use the following Stsadm command.
Stsadm –o import –url <URL> -filename <FileName>.cmp
To restore a site collection, you must use the following Stsadm command.
stsadm –o restore –url <URL of the site collection> -filename <Name of the backup file>
To restore an entire farm you can use the following Stsadm command.
stsadm –o restore –directory <UNC path or local drive> -restoremethod <overwrite or new>
So what are the types of backups we can perform. There are two types:
Full backup
Differential backup
Before you create a differential backup however, you need to at least perform a full backup for the first time.
USING STSADM EXPORT / IMPORT
Using STSADM EXPORT and IMPORT we can Export the complete web application and Import it in the Other Farm.
The command-line tool STSADM.exe supports only basic import and export operations and is only useful when importing or exporting entire SharePoint Web
sites or when reparenting a Web site. Content migrated using this tool will not retain object GUIDs. Note that you cannot use this utility to import or export individual items or lists.
stsadm.exe -o export
-url <URL to be exported>
-filename <export file name>
[-overwrite]
[-includeusersecurity]
[-haltonwarning]
[-haltonfatalerror]
[-nologfile]
[-versions <1-4>
1 - Last major version for files and list items (default)
2 - The current version, either the last major or the last minor
3 - Last major and last minor version for files and list items
4 - All versions for files and list items]
[-cabsize <integer from 1-1024 megabytes>]
[-quiet]
You must use the -includeusersecurity parameter in order to preserve time stamps, security information, and user data.
stsadm.exe -o import
-url <URL to import to>
-filename <import file name>
[-includeusersecurity]
[-haltonwarning]
[-haltonfatalerror]
[-nologfile]
[-updateversions <1-4>
1 - Add new versions to the current file (default)
2 - Overwrite the file and all its versions (delete then insert)
3 - Ignore the file
4 - Terminate with conflicts]
[-quiet]
More info
http://farhanfaiz.wordpress.com/2008/02/07/mossback-up-and-restore-site-collection-sites-using-stsadm-utility-export-import/
http://msdn.microsoft.com/en-us/library/aa979099.aspx
Using Content Migration Sharepoint API ( SPEXPORT / SPIMPORT)
Create a New Webapplication and
- Move all the Document Libraries from source to destination Using Content Deployment Migration ( SPEXPORT and SPIMPORT)\
The content import/export feature of the deployment object model allows you to export not only Web site content but also existing dependencies, like security features, user roles, versioning data, workflows, and other metadata.
The Microsoft.SharePoint.Deployment object model is designed to work with data ranging from an entire Web site to a single item in a list or library. The import/export features of the Microsoft.SharePoint.Deployment object model uses two key objects: Microsoft.SharePoint.Deployment.SPImport and Microsoft.SharePoint.Deployment.SPExport.
However, before you run the import or export operations using these objects, you must first specify your import or export settings using Microsoft.SharePoint.Deployment.SPImportSettings and Microsoft.SharePoint.Deployment.SPExportSettings objects. Then you simply call the Run() method on the SPImport or SPExport object, as appropriate.
You can get more info here
http://msdn.microsoft.com/en-us/library/aa979099.aspx
USING Sharepoint Central Administration ( Backup / Restore)
Using Central ADMIN Backup the Complete Farm and Restore the Complete Farm in the New Farm
More info
http://www.sharepointbeagle.com/channels/administration/Pages/MOSS2007BackupandRestoreOperations.aspx
Using Sharepoint Designer
We can find more info about this here
http://office.microsoft.com/en-us/sharepointdesigner/HA100699391033.aspx

Tuesday, 11 October 2011

Color Coded Calendar 2007 with fully covered color area




Before start this post I am thanking to the blog planetwilson because I found the color coded calendar article from there this is a modified version from there.
Step 1.  Create a calendar list in your sharepoint server
Step 2.  Create a column name Category  type--> choice    
  
 3.  Create a calculated column
Add caption
     Step 4:  Change the View settings


Step 5:  Add an Content Editor Webpart under the Calendar Control

Step 6:  Paste the following code

<script> 
 var SEPARATOR = "|||"; 
 var nodes, category; 
 nodes = document.getElementsByTagName("a"); 
 function getObjInnerText (obj) 
 {
   return (obj.innerText) ? obj.innerText : (obj.textContent) ? obj.textContent : ""; 
 }  
 for(var i = 0; i < nodes.length; i++) 
 { 
   if(getObjInnerText(nodes[i]).indexOf(SEPARATOR) != -1) 
   { 
     UpdateCalendarEntryText(nodes[i]); 
     var foundNode = nodes[i]; 
     var trap = 0; 
     while(foundNode.nodeName.toLowerCase() != "td") 
     { 
       foundNode = foundNode.parentNode; 
       trap++; 
       if(trap > 10) 
       { 
         break; // don't want to end up in a loop 
       } 
     } 
     var colourinfo = GetCalendarColourInfo(category); 
     if(colourinfo.bg != "") 
     { 
          var temp= foundNode.parentNode; 
          temp=temp.parentNode;
          temp=temp.parentNode;    

          temp.parentNode.style.background = colourinfo.bg; 
          foundNode.style.background = colourinfo.bg; 
     } 
     // try and update the text colour if we can TD/A/NOBR/B/#text 
     if(colourinfo.fg != "") 
     { 
       try 
       { 
         // there should only be one anchor tag 
         childNodes = foundNode.all; 
         for(var j = 0; j < childNodes.length; j++) 
         { 
           if(childNodes[j].nodeName.toLowerCase() == "a") 
           { 
             // found anchor tag 
             childNodes[j].style.color = colourinfo.fg; 
             // set the NOBR tag as well to set the time if it is shown, but set it on the B tag for month view 
             if(childNodes[j].children[0].nodeName.toLowerCase() == "nobr") 
             {  // month view has an extra b tag surrounding the text 
               childNodes[j].children[0].style.color = colourinfo.fg; 
               if(childNodes[j].children[0].children[0].nodeName.toLowerCase() == "b") 
               { 
                 childNodes[j].children[0].children[0].style.color = colourinfo.fg; 
               } 
             } 
             break; 
           } 
         } 
       } 
       catch(e) {} 
     } 
   } 
 } 
 function ColourInfo(bg, fg) 
 { 
   this.bg = bg; 
   this.fg = fg; 
 } 
 function UpdateCalendarEntryText(anchorNode) 
 { 
   var children = anchorNode.childNodes; 
   for(var i = 0; i < children.length; i++) 
   { 
     if(children[i].nodeType == 3 && children[i].nodeValue.indexOf(SEPARATOR) != -1) 
     { 
       var parts = children[i].nodeValue.split(SEPARATOR); 
       category = parts[0]; 
       children[i].nodeValue = parts[1];     
     } 
     else 
       UpdateCalendarEntryText(children[i]); 
   } 
 } 
 function GetCalendarColourInfo(desc) 
 { 
   var colour = new ColourInfo("", ""); 
   var trimmed = desc.replace(/^\s+|\s+$/g, '') ; 
   switch(trimmed.toLowerCase()) 
   { 
      case "appointment": 
           colour.bg = "#ffd266"; 
           colour.fg = ""; 
           break; 
           case "birthday": 
           colour.bg = "#ae99dc"; 
           colour.fg = ""; 
           break; 
           case "business": 
           colour.bg = "#8aabe0"; 
           colour.fg = ""; 
           break; 
           case "important": 
           colour.bg = "#e77379"; 
           colour.fg = ""; 
           break; 
           case "vacation": 
           colour.bg = "#fffa91"; 
           colour.fg = ""; 
           break; 
     default: 
     { 
       colour.bg = ""; 
       colour.fg = ""; 
     } 
   } 
   return colour; 
 } 
 </script> 

Step 5:  Exit the edit mode   Happy Coding

Configure outgoing e-mail settings (Office SharePoint Server)


Use this procedure to configure the default outgoing e-mail settings for all Web applications. You can override the default outgoing e-mail settings for specific Web applications by using the procedure that is described in Configure outgoing e-mail settings for a specific Web application (Office SharePoint Server).

Install and configure the SMTP service

Before you can enable outgoing e-mail, you must install the Internet Information Services (IIS) Simple Mail Transfer Protocol (SMTP) service. After determining which SMTP server to use, the SMTP server must be configured to allow anonymous access and to allow e-mail messages to be relayed. Additionally, the SMTP server must have Internet access if you want the ability to send messages to external e-mail addresses, or it must be able to relay authenticated e-mail to a server that has Internet access. The SMTP server that you use can be a server in the farm, or another server.

Install the SMTP service

The SMTP service is a component of IIS.

Install the SMTP service

  1. In Control Panel, click Add or Remove Programs.
  2. In Add or Remove Programs, click Add/Remove Windows Components.
  3. In the Windows Components Wizard, in the Components box, click Application Server, and then click the Details button.
  4. In the Application Server dialog box, in the Subcomponents of Application Server box, click Internet Information Services (IIS), and then click the Details button.
  5. In the Internet Information Services (IIS) dialog box, select the SMTP Service check box.
  6. Click OK to return to the Application Server dialog box.
  7. Click OK to return to the main page of the Windows Components Wizard.
  8. Click Next.
  9. When Windows has finished installing the SMTP service, on the Completing the Windows Components Wizard page, click Finish.

Configure the SMTP service

After installing the SMTP service, configure the service to accept relayed e-mail from servers in your farm.
You can decide to accept relayed e-mail from all servers except those you specifically exclude. Alternatively, you can block e-mail from all servers except those you specifically include. You can include servers individually, or in groups by subnet or domain.
By enabling both anonymous access and e-mail relaying, you increase the possibility that the SMTP server will be used to relay unsolicited commercial e-mail (spam). It is important to limit this possibility by carefully configuring your mail servers to help protect against spam. One way that you can do this is by limiting relaying to a specific list of servers or domain, and preventing relaying from all other servers.
Important Important:
Membership in the Administrators group on the local computer is required to complete this procedure.

Configure the SMTP service

  1. Click Start, point to All Programs, point to Administrative Tools, and then click Internet Information Services (IIS) Manager.
  2. In IIS Manager, expand the server name that contains the SMTP server that you want to configure.
  3. Right-click the SMTP virtual server that you want to configure, and then click Properties.
  4. On the Access tab, under Access control, click Authentication.
  5. In the Authentication dialog box, under Select acceptable authentication methods for this resource, verify that Anonymous access is selected.
  6. Click OK.
  7. On the Access tab, under Relay restrictions, click Relay.
  8. To enable relaying from any server, under Select which computer may relay through this virtual server, select All except the list below.
  9. To accept relaying from one or more specific servers, follow these steps:
    1. Under Select which computer may relay through this virtual server, select Only the list below.
    2. Click Add, and then add servers one at a time by IP address, or in groups by using a subnet or domain.
    3. Click OK to close the Computer dialog box.
  10. Click OK to close the Relay Restrictions dialog box.
  11. Click OK to close the Properties dialog box.

Configure outgoing e-mail settings

Important Important:
Membership in the Farm Administrators group of the Central Administration site is required to complete this procedure.

Configure outgoing e-mail settings

  1. On the top navigation bar of the SharePoint Central Administration Web site, click Operations.
  2. On the Operations page, in the Topology and Services section, click Outgoing e-mail settings.
  3. On the Outgoing E-Mail Settings page, in the Mail Settings section, type the SMTP server name for outgoing e-mail (for example, mail.example.com) in the Outbound SMTP serverbox.
  4. In the From address box, type the e-mail friendly address as you want it to appear to e-mail recipients.
  5. In the Reply-to address box, type the e-mail address to which you want e-mail recipients to reply.
  6. In the Character set menu, select the character set that is appropriate for your language.
  7. Click OK.
    For information about how to perform this procedure using the Stsadm command-line tool, see Email: Stsadm operation (Office SharePoint Server).

Thursday, 18 August 2011

Difference between Classic Authentication and Claim based authentication

What are the differences between Classic Mode Authentication and Claims based Authentication?

Classic Mode Authentication: It refers to the integrated windows authentication. You cannot configure the Forms based authentication if your web application is using Classic Mode Authentication. You can convert a web application from Classic Mode Authentication to Claims Based Authentication. However, that can only be done using PowerShell commands and its an irreversible process. I have detailed steps to convert the web application from Classic Mode authentication to Claims Based Authentication.

Claims Based Authentication: SharePoint 2010 is built on Windows Identity Foundation. It enables authentication from windows as well as non-windows based systems. This also provides the capability to have multiple authentication in a single URL.

Thursday, 4 August 2011

What is Server Farm and Front End Web Server

Server Farm:
SharePoint Server farm environments can encompass a wide range of topologies, and can include many servers or as few as two servers.
  • A small server farm typically consists of a database server running Microsoft SQL Server , and one or more servers running Internet Information Services (IIS) and Office SharePoint Server 2007. In this configuration, the front-end servers are configured as Web servers and application servers. The Web server role provides Web content to clients. The application server role provides Office SharePoint Server 2007 services such as servicing search queries, and crawling and indexing content.
  • A medium server farm typically consists of a database server, an application server running Office SharePoint Server 2007, and one or two front-end Web servers running Office SharePoint Server 2007 and IIS. In this configuration, the application server provides indexing services and Excel Calculation Services, and the front-end Web servers service search queries and provide Web content.
  • A large server farm typically consists of two or more clustered database servers, several load-balanced front-end Web servers running Office SharePoint Server 2007, and two or more application servers running Office SharePoint Server 2007. In this configuration, each of the application servers provides specific Office SharePoint Server 2007 services such as indexing or Excel Calculation Services, and the front-end servers provide Web content.
  • You can deploy Office SharePoint Server 2007 in a server farm environment if you are hosting a large number of sites, if you want the best possible performance, or if you want the scalability of a multi-tier topology. A server farm consists of one or more servers dedicated to running the Office SharePoint Server 2007 application
Front End Web Server

            In a server farm environment, the front-end Web servers contain only the files and settings required to route requests from clients to the appropriate sites in the database. Unlike in SharePoint Team Services v1.0 from Microsoft, they do not contain site data.
            All site content and all configuration data is shared for all front-end Web servers in a server farm. To get the best performance and the best protection against hardware failure, you should configure Windows SharePoint Services identically on all the front-end Web servers in your server farm.

Wednesday, 3 August 2011

Site collection & Subsite defintion

Site Collection:
                 A SharePoint site collection is a hierarchical set of sites that can be managed together. Sites within a site collection have common features, such as shared permissions, galleries for templates, content types, and Web Parts, and they often share a common navigation. A site collection contains a single top-level site, and any number of subsites organized in a hierarchy. A subsite is a single SharePoint site within a site collection.


SubSites:
A subsite can inherit permissions and navigation structure from its parent site, or these can be specified and managed independently. Creation of subsites can be delegated to users of a site collection, but creation of site collections must be performed by a service administrator.

Saturday, 30 July 2011

Object Model Defintion in Sharepoint

What is Object Model:
        Collection of classes and methods in general.   At the time of developing webparts or workflow we need some details from the SharePoint site it may be a list item, list, site url , subsite exatra....    To provide these information SharePoint have predefined collection of classes, object and function this is exactly called Object Model in SharePoint.

          For example SPContext return the information about the current site.