0

I am writing a code which does a restore of site collection programatically. I am using Site Deleting Event handler. I need to take backup of individual Site, not the Site Collection. How should i do it?

4 Answers 4

2

I don't think SPWeb objects have a Backup method like how Site Collections do, so you may have to somehow call stsadm from within your event handler code.

1
  • SharePoint doesn't allow you to backup/restore, move, etc. SPWeb objects like you can with an SPSite object. SPWeb objects are completely dependent on the SPSite that they belong to, thus you cannot back them up or restore them independently of the SPSite. May 9, 2012 at 15:45
2

The SharePoint Site Recycle Bin functionality that is a part of the Microsoft SharePoint Governance and Manageability project on codeplex does something similar to what you want.

The SharePoint Site Recycle Bin is a SharePoint Foundation 2010 solution package that when deployed to a Microsoft SharePoint Foundation 2010 or Microsoft SharePoint Server 2010 server farm enables administrators to create a snapshot of subscriptions, site collections and Webs as they are deleted through the SharePoint user interface, the SharePoint Administration Tool, the SharePoint 2010 Management Shell, SharePoint 2010 Central Administration, or SharePoint Designer.

There is a version for SharePoint 2007 as well.

0

I believe you can get the equivalent of an stsadm -o export out of the Content Deployment API. Check out the MSDN page.

0

using SPExportObject will do the job.

1
  • 1
    While this may theoretically answer the question, we prefer inclusion of the essential parts of the answer here, and to provide the link for reference. See answer for general guidelines.
    – SPDoctor
    May 7, 2012 at 17:34

Your Answer

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

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