Hi All,
In my application i got the requirenent to move the sites present in one site collection oter site collecton. can any one help how to achive this using c sharp code or any other ways to get this.
Thanks in Advance
Mastan.sheik
Loading
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Amaresh Reddy12 reputationPosted Oct 17, 2012, 11:12 PM EDT
To move the sites from one site collection to any other site collection. These are the following ways
1. Using Sharepoint 2010 Power shell you can export and import all the sites
Command : Export-SPWeb -Identity "http://xxxxxxxxx" -Path "C:\backupfilename.bak"
Command : Import-SPWeb -Identity "http://xxxxxxxxx" -Path "C:\backupfilename.bak"
2. Download the site template required.
In the site settings -> Save Site As Template -> The site will be stored in solution gallery as WSP.
Download the WSP from the current site collection and upload the WSP in to the required site collection. The template will be shown in new site creation. Create new sites using the template with content.
Yours
Amaresh Reddy
Mastan Sheik5 reputationPosted Oct 18, 2012, 2:39 AM EDT
please let me know is there any way to excute these poweshell commands using C# code.
Amaresh Reddy12 reputationPosted Nov 7, 2012, 7:46 PM EST
You can export and import the sites programmatically. The following are the objects to export and import using c#
SPExport - It will export the site to a location.
SPImport - It will import the site from a location
Regards
Amaresh