Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

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

3 Answers 3

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/

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: http://stackoverflow.com/questions/1378553/sharepoint-copy-a-list-to-a-different-web

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:

http://www.codeproject.com/KB/sharepoint/SPCopy.aspx

share|improve this answer

Your Answer

 
discard

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.