1 / 34

SharePoint Feature and Solution upgrading

SharePoint Feature and Solution upgrading. Bram de Jager | Lead SharePoint Developer | Macaw. About Bram. Lead SharePoint developer / architect for Information Worker Solutions center of Macaw Started with SharePoint 2003

felton
Download Presentation

SharePoint Feature and Solution upgrading

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. SharePoint Feature and Solution upgrading Bram de Jager | Lead SharePoint Developer | Macaw

  2. About Bram • Lead SharePoint developer / architect for Information Worker Solutions center of Macaw • Started with SharePoint 2003 • Worked on projects for Shell, HogeschoolINHolland, Library of Rotterdam and Univé. • Contact • http://bramdejager.wordpress.com • @bramdejager • bram.de.jager@macaw.nl

  3. Agenda • Basics • Solution Upgrade • Feature Upgrade • Summary

  4. Why? • Creating / updating a content type in 1 site collection is easy • But having 20 site collections and 10 content types changes the game

  5. When to use a feature? • Isolated/ autonomous piece of functionality • Distributed deployment • Scoping where XML or custom code runs

  6. Initial build (trade-off) • Custom code vs. XML • Code: • Ability to DEBUG • More control • Upgrade artifact requires code • XML: • Site definitions, list template, delegate controls, custom actions…

  7. How was it done in 2007? • Solution deployment: deploy and retract • Upgrade was supported but did not install new features • Feature events: (un)install and (de)activate • No upgrade support, you would deactivate and active the feature to trigger any logic

  8. Deployment life-cycle

  9. Create solution with choice field, deploy via PowerShell Demo

  10. SharePoint Feature and Solution Upgrading Solution Upgrade

  11. Farm vs. User solutions • Farm solutions supports granular upgrade • User solutions will automatically upgrade all features to the latest version

  12. Farm solution upgrade • Update-SPSolution–Identity DevDays.wsp –LiteralPath C:\DevDays.wsp –GACDeployment • Farm wide • psconfig -cmd upgrade -inplaceb2b • Granular • QueryFeatures() & Feature.Upgrade()

  13. Granular upgrade • QueryFeatures() • GuidfeatureId • GuidfeatureId, boolneedsUpgrade • GuidfeatureId, Version featureVersion • SPFeatureScopescope, boolneedsUpgrade • Available for SPWebService (farm), SPWebApplication, SPContentDatabase, SPSite • Feature.Upgrade()

  14. Upgrade life-cycle

  15. Replacement or Update • Retract & Deploy • Only on initial deployment! • Replaces all feature instances with definition • Does not trigger upgrade actions • No feature upgrade possible! • Update • On new version of the solution • Deploys to file system • Doesn’t trigger install for new feature :-S

  16. User solution upgrade • Upload new solution package in Solution Gallery • Press Upgrade button • Solution and features are upgraded • It’s all or nothing

  17. SharePoint Feature and Solution Upgrading Feature Upgrade

  18. Versioning • Version attribute • On activation a feature instance is created • Deploy new version, feature definition gets updated • Easy tracking of feature definition and associated feature instances

  19. Feature Upgrade • Upgrade according to upgrade actions • Based on VersionRange with Begin & End versions • Actions for 0.0.0.0 – 0.9.9.9 • Other actions for 1.0.0.0 – 1.9.9.9

  20. Multiple versions scenario • v1.0.0.0 • Create Contacts list instance • v2.0.0.0 • Add creation Events list instance • v3.0.0.0 • Add creation Issues list instance

  21. Site A Site B Site C Feature DevDays v1.0.0.0 Feature DevDays v1.0.0.0 Feature DevDays v2.0.0.0 Feature DevDays v3.0.0.0 Feature DevDays v2.0.0.0 Feature DevDays v3.0.0.0 Feature DevDays v3.0.0.0 Feature DevDays v3.0.0.0 DevDays.wsp DevDays.wsp DevDays.wsp

  22. Dependencies • Child-child element of feature.xml • <ActivationDependency> element • New MinimumVersionattribute

  23. UIVersion attribute • New UIVersionattribute of feature.xml • Specifies UI version for this feature with operators (=, <, >, <=, >=, ;) • Based on SPWeb.UIVersion (3 or 4) • Example: Ribbon custom actions

  24. Declarative upgrade actions • New child element in feature.xml • <UpgradeActions> element • <VersionRange> • <ApplyElementManifest> • <AddContentTypeField> • <MapFile>

  25. Versioning scenario Demo

  26. CustomUpgradeAction • Child element of <UpgradeActions> • <CustomUpgradeAction> • New feature receiver FeatureUpgrading() • Support for parameters

  27. Adding field to content type, copy contents, hide old field Demo

  28. SharePoint Feature and Solution Upgrading Summary

  29. Upgrade approach • Solution update instead of retract/deploy • New feature • Staple to existing site definition for new sites • Script activation on existing sites • Upgrade existing feature • Farm wide or granular upgrade

  30. Gotchas • BeginVersioninclusivebut EndVersionnot • Solution upgrade does not trigger (un)install event feature • When adding new feature after initial deployment, no (un)install event. Manual Install-SPFeature. • Quit PowerShell when building (out of sync) • Enable ULS logging, change setting to Verbose • Feature Infrastructure, Fields, General

  31. SharePoint Feature and Solution Upgrading Q&A

  32. Resources • MSDN – Packaging and Deployment • Chris O’Brien “Nuts andBolts”-blog

More Related