Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

We have a set of custom site definitions, around 12 in total, that makes up a large sharepoint 2010 intranet application (circa 40,000 sub-sites) that has been deployed for a few years now.

One of these site definitions now needs some tweaks. Namely, a new page adding to it with some pre-configured web parts, and inserting a new web part into the landing page.

I understand I can create a new feature for this update, and associate it with the site definition in question, and that's all fine for new sites being provisioned from this site definition, but how do I go about applying the same changes to the existing 40,000 sites, which also need the update?

Thanks for any assistance, Tony

share|improve this question
    
Remember that any change in onet.xml of a custom site definition is unsupported you need to add the new functionality using feature stapling. This is exactly why you should not use custom site definitions, but web templates in SharePoint 2010!! –  Anders Rask Sep 25 '12 at 18:38
    
Should have mentioned the site definitions are just containers for features in this case. –  deepcode.co.uk Sep 25 '12 at 22:55
    
it doesnt matter really. You cannot change the ONET.XML manifest, as long as you dont do that you are good :) Next time use Web Templates ;) –  Anders Rask Sep 26 '12 at 15:09
add comment

2 Answers

up vote 4 down vote accepted

You could loop through all the existing sub-sites with a PowerShell script, and use the feature cmdlets to activate the feature on existing sites. Using this method you could also insert some logic/conditions to enable or not enable the new feature if that is useful.

share|improve this answer
    
I like this idea, but have a follow on question. Is it wise to create new features each time, which was my plan, or should I be using the feature upgrade capability and the doing the above loop to upgrade each existing site? –  deepcode.co.uk Sep 25 '12 at 22:58
add comment

You need to develop what I call a "service pack" to deploy against the existing sites. In this case your service pack would contain a module with the site pages and any other resources that might be required.

If your solution is only adding new artifacts to the site, the process is pretty straightforward. If you are changing things like list structures, it's still doable but you might have to write some code to make that happen. For example, if you need to update the quick launch you'll have to write code in a Feature Receiver to add the new entries.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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