SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question

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

Available for download here:

share|improve this answer
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 '11 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:

share|improve this answer

Most likely, you will need to use SPImport and SPExport classes. Here is an article, which explains, how to work with them:

share|improve this answer

Your Answer


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.