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 am trying to understand how to restore an arbitrary library to an arbitrary site in an arbitary site collection - inspired by some future user announcing he accidentally deleted a document from the library (and recycle bin is not an option). Let's assume the user does not even know the document name but would recognize it if a copy of the lib were restored from a backup.

With that goal, I've been experimenting with some Powershell scripts which export sites in my farm. This one uses file compression by default:

Get-SPSite | foreach-object {
$_.allwebs | foreach-object {
    $ExportDir = "\\BLACKTIP\SharePointBackups\Export-WebSites\" + $_.Url.replace("http://","").Replace("/","-");
    $ExportFname = $ExportDir + ".cmp";
    Export-SPWeb -Identity $_.Url -Path $ExportFname -Force


Consider a given subsite HR within a site collection http://blacktip/sites/cbmi: I see the following files in the export directory:


I looked over the syntax for Import-SPWeb and tried a couple of things:

import-spweb `http://blacktip/sites/cbmi/restoreHR` -Path "C:\SharepointBackups\Export-WebSites\blacktip-sites-cbmi-HR.cmp"

The above is based on the hope that maybe it would create a subsite called restoreHR based on the properties of the exported site. Got error: Cannot find an SPWeb object with Id or Url : http://blacktip/sites/cbmi/restoreHR which of course makes sense.

So, I created a subsite called HRrestored (not knowing what template to use) and then I got this error: Cannot import site. The exported site is based on the template STS#1 but the destination site is based on the template STS#0. You can import sites only into sites that are based on same template as the exported site.

What are the best practices for something like this? How to the "pros" handle these sort of ad-hoc requests for restoration of arbitrary resources within Sharepoint (assuming granular backups have been taken, what are best practices for restoring things?).

share|improve this question
up vote 2 down vote accepted

It seems that source and destination sites are not created from the same template. The source site is based upon Blank Site template (STS#1) but the destination site is based upon Team site template (STS#0). So, create a site with Blank site template and perform the import again.

Here is the list of site templates:

More about backing up Sites or list:

share|improve this answer
Thank you. Good advice. – John Adams Jan 7 '13 at 1:15

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.