Best practices for share point solution deployment

  • View
    7.399

  • Download
    1

Embed Size (px)

DESCRIPTION

Best practices for share point solution deployment

Transcript

  • 1. Salaudeen Rajack [email_address] Best Practices forSharePoint Solution Deployment

2. SharePoint Solution Packages

    • What is a solution package?
    • Asolution packageis a distribution package that delivers your custom SharePoint Server development work to the Web servers or the application servers in your server farm.
    • Use solutions to package and deploy
      • custom Features
      • site definitions, Master Pages
      • Application Pages, Custom Pages, layout pages
      • Templates, Images
      • Web Parts, User Controls
      • Cascading style sheets
      • Event Receivers, Workflow Activities, Workflow Assemblies
      • Global Resources (.resx files)
      • Policies and assemblies.
    • WSP files are just CAB file with .WSP extension.
    • Templates and/or components in an installable unit
    • Package that contains metadata (manifest.xml)

3. Master pages, layouts, CSS, images, scripts Developer Reference

  • Into a library inside your site collection
    • Can be referenced by ~site, ~sitecollection and ~masterpage
    • Only available within the site collection
    • Too many site collection makes it harder to update these files
    • Updatable through the web interface
  • Into the _LAYOUTS folder
    • Can be referenced by path to folder
    • Available for every Sharepoint website in farm
    • One place for easy updating these files
    • Only updatable directly on the server
    • All web applications on the server share this folder

4.

  • Site Customizations
    • Changes to one particular site recorded in content DB
    • Done using the browser or the SharePoint Designer
    • Easy to do but hard to reuse
  • Solution Development
    • Creation of reusable templates/components
    • Templates/components installed on Web server
    • Development based on Visual Studio projects
    • Project source files checked into source code control
    • Projects can be moved through staging to production

Site customizations Vs Solutions Development 5. Solution Life Cycle 6. Tools

  • WSPBuilder
    • Creates SharePoint Solutions files based on a folder structure
    • Deploy solutions
  • SharePoint Installer
    • Creating user friendly installation and deployments for SharePoint 2007 solutions
  • VSeWSS 1.2
    • Visual Studio 2008 extensions
  • STSDEV
    • Generate Visual Studio project files and solution files
  • STSADM
    • 184 operations through command line on the web server
    • Custom extensions possible

7. Deploying SharePoint Solutions

  • Add .WSP to the solution store
    • Via command line using STSADM
    • Via object model
  • Deploy to all or individual Web Applications
    • Via Central Administration(solution mgmt)
    • Via Command-line
    • Via Object Model

Front-End Web Servers Stsadm o addsolutionfilenamemypackage.wsp Solution Store stsadm -o deploysolution-namemypackage.wsp local -urlIISWebApp 8. Retracting SharePoint Solutions

  • Retracting is removing the solution components from the servers where it was deployed
  • Be aware :
    • Post-retracting actions can be necessary (e.g. Web Parts)
    • Once instances have been created from schemas (e.g. List templates), retracting a solution is not adviced. Leave the solution on the server but hide the Features making the solution components available

9. Upgrading Solutions Stsadm o addsolution filename mysolution.wsp DeploySolution Stsadm o upgradesolution -name mysolution.wspfilename mysolution.wsp immediate -allowgacdeployment MySolution.wsp (v 1.0) MySolution.wsp (v 2.0) MySolution.wsp SolutionID must be the same! 10.

  • Feature-based Components
    • Custom Application Page
    • Site Page Templates
    • Master Pages
    • Web Parts
    • Site Columns and Content Types
    • Custom List and Document Library Definitions
    • List-based Event Handlers
    • Custom Workflows
  • Components creating without using features
    • Custom Field Types
    • Site Definitions

WSS Component Development 11. Features

  • A building block for creating SharePoint solutions
    • A unit of design, implementation and deployment
  • Features can contain elements
    • e.g. menu items, links, list types and list instances
  • Features can contain event handlers
    • You can add any code which used WSS object model
  • Features can depend on other Features
  • Features can be stapled

12. Solution deployment

  • Featurize your custom development
    • Any SharePoint element
    • Changes in your web.config
    • Copying files to specific web folders
  • Deploy features and other assets by WSP Solution package
  • Your development machine does not go into production
  • Use a buildserver
  • Always test with different set of browsers (level 1 and level 2)
  • Watch out for rights

13.

  • This is where many of your development files need to be deployed
    • Most files go into templates directory

The Root files directory: Web Service files GLOBAL .RESX files Application Pages User Controls Features Field*.xml files Site Definitions Images Admin Pages 14. Whats inside manifest.xml MyStuff.wsp manifest.xml Other Stuff Templates/components 15.

  • Defines Solution properties and contents

A Sample Manifest.xml file 16.

  • Use WSP Builder (codeplex)
  • Can done using MAKECAB.EXE also
    • Requires .DDF input file

Building the .WSP file Solution Package Build Process Input DDF File MAKECAB.EXE Output WSP File 17.

  • DDF file must build proper folder structure
    • Prefer.Set DestinationDirinstruction

DDF file closer look MyStuff.wsp 18.

  • (1) Solution Package Installation
    • .WSP file is copied to ConfigDB
  • (2) Solution Package Deployment
    • .WSP pushed out to Web servers
    • Usually requires IIS Reset operation
    • Done in productionfarm in off hours

REM - Deploy Solution Package MyStuff.wsp to Web servers in farm %STSADM% -o deploysolution -name MyStuff.wsp -immediate REM force batch file to run timer job synchronously %STSADM% -o execadmsvcjobs REM - Install CustomApplicationPages.wsp in WSS Solution Package Store %STSADM% -o addsolution -filename MyStuff.wsp REM force batch file to run timer job synchronously %STSADM% -o execadmsvcjobs Two Phases of WSP Deployment .WSP Install WSP ConfigDB .WSP Deploy WFE WFE WFE ConfigDB WSP 19.

  • Central Admin provides some control
    • Allows you to see and deploy .WSP files
    • Does not provide a way to install .WSP files

Solution Management 20.

  • Central Admin allows some inspection

Solution Package Properties 21.

  • Best Practices
    • Create solution-specific directory in LAYOUTS
    • Use code-behind with DLL installed in GAC
    • Adding a complimentary feature for navigation

Application Pages -Best Practices 22.