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 have one site collection at root level and which contains more than 50 subsites. I am planning to schedule a daily job to take the backup of sharepoint subsites. I also want to check the size of the each subsite and list them with their name in CSV format.

Please if any one can help me in doing so, thanks in well advance.

share|improve this question
add comment

2 Answers

How big is the sitecollection? which version of sharePoint you are using?

if its too big bestway to do is scheduled the sql Backup.

I Prefered to go for the Site collection backup instead of each subsite backups.

just use the normal powershell command to backup the Site Collection.

Regarding to the each subsite size you can use the third party tool to find the website size. here is the link :

http://scmodsoft.com/product/sharepoint-space-monitor/

share|improve this answer
    
Thanks for your response. my site collection is of 60 GB. I allready have sql job scheduled for backup.but with this i can not immediately provide user of one subsite only their backups and restore time and effort are also more.same is the problem with sitecollection backup. I even can not trust third party due to security consern –  Mitul Rana Apr 2 '13 at 1:17
    
Why you need to provide a user their backups? Its better to provide user on-demand backup files if they need it. In my view its not a good idea to do a subsite level backup everyday unless needed. The link which i provided is give you the idea about the size of the subsites. it will not do backup of the site. –  user994521 Apr 2 '13 at 6:02
    
THe case is like that if i have to restore one sub-site i have to restore complete site collection which is not feasable .Every sub site have so many content editor i only needs to take back for their respective changes –  Mitul Rana Apr 2 '13 at 6:44
add comment

You could do something like this in PowerShell. This script will export all your subsites for a single site collection in a compressed format.

$site = new-object microsoft.sharepoint.spsite("Your site collection URL")


Write-Host  "Started Exporting" +  -foregroundcolor green
foreach ($w in $site.AllWebs)

{
       #adding all letters are omited...you can adjust it yo your needs.
       if ($w.URL -like "*/A/A*" -or $w.URL -like "*/B/B*" -or $w.URL -like "*/C/C*" )



{
               "`r`n`tBegin : Exporting the site  " + $w.Name
                   $backuppath = "C:\Backup\" + $w.Name + ".cmp"   
                   Export-SPWeb -Identity $w.URL –Path $backuppath -IncludeUserSecurity -IncludeVersions All -HaltOnError 
               "`tEnd : Exporting the site " + $w.Name


                  If ($w -ne $null)
                    {
                    $w.Dispose()
                  }

   }

}
Write-Host “Sites exported/imported successfully " -foregroundcolor green
If ($site -ne $null)
{
   $site.Dispose()
}

To check size of each subsite have a look into this script

http://get-spscripts.com/2010/08/check-size-of-sharepoint-2010-sites.html

share|improve this answer
    
Thanks for your post .This resolves my concern –  Mitul Rana Apr 12 '13 at 2:26
1  
# #Add sharepoint powershell command $backuppath='c:\bacups' add-PSSnapin Microsoft.Sharepoint.Powershell # $sites=Get-SPWebApplication "url of farm" | Get-SPSite -limit ALL| Get-SPWeb -limit ALL # foreach($site in $sites){ Export-SPWeb -Identity $site.Url -Path "$backupfolder\$($site.Title)" -Force Write-Host "Successfulle backed up $($site.Url) to $backupfolder\$($site.Title)" } –  Mitul Rana Apr 12 '13 at 2:27
    
Kindly click on the right icon to mark it as answer if this resolves your concern. This validates the answer in the system and helps others who might be having the same problem. Thanks –  Arko D Apr 12 '13 at 8:32
add comment

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.