I'm iterating SPWebs and SPLists. When those lists fulfil specific requirements, I would like to export the lists in code, and later import them to another SharePoint environment (using code).
How should this be accomplished?
|
I'm iterating SPWebs and SPLists. When those lists fulfil specific requirements, I would like to export the lists in code, and later import them to another SharePoint environment (using code). How should this be accomplished? |
||||
|
|
|
Sounds like you want something along the lines of the Content Deployment Wizard by our very own Chris O'Brien: http://www.sharepointnutsandbolts.com/2007/12/introducing-sharepoint-content.html Available for download here: http://spdeploymentwizard.codeplex.com/ |
|||
|
|
I can recommend using Gary Lapointe's custom STSADM commands. You can call the stsadm commands from a console application using Process. I needed to keep the list's people fields intact which is why I chose gl-exportlist. Another reference: http://stackoverflow.com/questions/1378553/sharepoint-copy-a-list-to-a-different-web |
|||
|
|
|
Most likely, you will need to use SPImport and SPExport classes. Here is an article, which explains, how to work with them: |
|||
|
|