There is already a content type whhich is created on RootWeb of a alll Site collections. this Content type has been created programmatically (site scoped feature) so that it gets dynamic guid (id). Now I have to give this content type a static id (guid). the problem is there are too many lists and documents which already used (added) this content type. the question is what is the best solution (safe). do I delete the content type from all rootWebs, lists and recreate it (with a static id) and add it again to the lists? or is there a way to update the id of the content type? I need some code sample (I myself prefer powershell) thanks for any advice.
1 Answer
I suggest following plan:
- Create the new ContentType with the right id.
- Add it to all the site collections that need it
- Add it to all the lists that need it
- Change the contenttype of all the listitems
- Remove the old content type from all the lists
- Delete the old content type from all the site collections