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?

3 Answers 3


Sounds like you want something along the lines of the Content Deployment Wizard by our very own Chris O'Brien:


Available for download here: http://spdeploymentwizard.codeplex.com/

  • I forgot to mention one important detail in my question; I will export from SP 2003 and import to SP 2007. Will this be a problem using this tool? I see from one of the comments on the page by Peter that he has sucsessfully done this, but the description on codeplex says this is a tool for SP 2007/2010.
    – Morten
    May 2, 2011 at 7:45

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: https://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:


Your Answer

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

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