10 02 2010
Sharepoint – Moving Webs from a Parent Web to another Parent Web
I have an upcoming requirement to be able to move SPWebs from one parent SPWeb to another. Let me lay out the current architecture:
- Site Collection
- Active Projects (web)
- Project 1 (web)
- Doc Library
- Custom List
- Project 2 (web)
- Doc Library
- Custom List
Things to note here are that each of the Project’s webs (project 1, project 2) are created from a Site Template (stp) which create an empty Document Library and an empty Custom List.
The requirement is to implement full project lifecycle, from a pre-project stage (where work is Ad-hoc, and not officially classified by the company as a “Project” (yet to be monitored for time-keeping purposes)) – through to Live Projects, and then at end of Life for the project to be archived.
Since each project is stored within an SPWeb object, it will now be assumed that a Pre-project web is created at the start, once the work is commissioned as a full project, to move the SPWeb object and all it’s contents from the parent SPWeb containing the Pre-Project sites into the SPWeb that represents Active Projects; and similarly move the SPWeb into Archived Projects SPWeb at the end of it’s life cycle.
The assumed layout would then look like this:
- Site Collection
- Pre-Project Stage (web)
- Pre-project 1 (web)
- Doc Library
- Custom List
- Pre-project 2 (web)
- Doc Library
- Custom List
- Pre-project 1 (web)
- Active Project Stage (web)
- Project 1 (web)
- Doc Library
- Custom List
- Project 2 (web)
- Doc Library
- Custom List
- Project 1 (web)
- Archived Project Stage (web)
- Dead Project 1 (web)
- Doc Library
- Custom List
- Dead Project 2 (web)
- Doc Library
- Custom List
My issue now is to find the most efficient way to move a project’s SPWeb from one parent to another, by using an option available to people with only certain privileges.
I’m gonna be busy…
document.getElementById() in MSIE Sharepoint User Group UK – Manchester March 9th 2010
Which options do you have available? Backend access to server? C#?..
I’d prefer if specific users within the company (Programme Managers) could do this themselves within the SP Environment, so I’d be thinking to write a Feature or something in C#…
My skills to date have mostly evolved around Web Parts and Event Handlers, got some more reading to do I think 🙂
Perhaps this might be of some use:
http://blogs.technet.com/stefan_gossner/archive/2007/08/30/deep-dive-into-the-sharepoint-content-deployment-and-migration-api-part-1.aspx
Cheers Boris, will have a look at that. Was also thinking about using stsadm -o export/import from the code.