2

There have been several questions asked on this site regarding the best way to provision sites and lists (definition schemas vs. templates vs. the object model vs. the web interface vs. provisioning providers). I have even responded to some of them.

Custom site definition to define a custom site with a subsite

Best way to build out and configure multiple lists

When to use Custom Site Definitions... and not

There are a few rules of thumb to go by (resources, permissions, ease of deployment, granularity of control). One thing that has to be considered, though, is how do you propogate changes to a site definition to the sites that have been created from it. Changes to web templates only affect new sites that are created from them. My understanding was that this is not the case with site definition schemas (and list definition schemas). I understand that you can only add to a definition once a site has been created from it or the sites will break, but I saw the note on this page in the MSDN library yesterday and it concerned me: http://msdn.microsoft.com/en-us/library/ms434313.aspx

We rely pretty heavily on the object model to provision modification to sites once they have been created. At the same time, we have been fortunate to not have had many major changes to our site definitions post-production, but that won't last forever.

There is a blog post at http://mymemorysucks.wordpress.com/2009/02/25/site-definitions-vs-site-templates-and-site-provisioning-providers/ that makes a case for always using a provisioning provider over site definitions and templates, but I get mixed signals because the Microsoft developer exams seemed put a lot of weight on site definitions and templates.

So, what are the best practices for modifying your sites/lists after they have been created and are in production? How do ISV's, for example, handle upgrades to their SharePoint based software?

2 Answers 2

2

Upgrading artifacts depends on the type of artifact in question, and depending on the platform (MOSS vs SP2010).

In SharePoint 2010 question the story is different than in SharePoint 2007, since you have feature upgrade, both declaratively and programmaticly (feature upgrade event handler with parameters set declaratively). Further info regarding feature upgrade can be found in my article on the subject in the DIWUG SharePoint eMagazine http://andersrask.spoint.me/2010/06/02/code-samples-from-diwug-article

As the article you refer to mentions, changing the manifests of a site definition after the site is created, isnt supported. This is why many developers (as mentioned in some of the threads you link to) prefer to keep their site definitions minimal, and instead put as much of the functionality into features and staple them on your site definition.

Provisioning providers are helpful when you want to put "finishing touches" on your site after it was created. This could include setting policies, creating sub sites, setting default pages, activating features, page layout restrictions, configuring web parts etc.

0
1

This is (as I'm sure you're aware) a huge, ongoing discussion point that (from whenever I see it) always ends up in the classic consultant response "It depends on your requirements".

I think once a site has been provisioned as per site template it's quite safe to modify the XML schemas as the provisioned content is then stored in the content database, however it may produce issues if yoour information workers then decide to create site templates (STP files) from the site definitions.

1
  • Thanks for the thoughtful response, James. You're right, I've wondered for some time why there does not seem to be a standard for this. It doesn't seem it should be as complicated as it is, but I hadn't thought of it from the angle that users can change site/list instances too. I guess that's the kind of thing that makes this more challenging then updating, say, a SQL Server schema.
    – Rob Wilson
    Jul 27, 2010 at 1:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.