1

How do you figure out the current size of the sharepoint web application? Better yet, the size of a site collection or a subsite.

I am planning to move a site collection from one farm to another. I need to plan the storage capacity first.

Indra
  • 73
  • 1
  • 8
  • Mines about 12" by 8" :) can you clarify your question at all? – Ryan Jun 03 '10 at 11:02
  • I am asking about the storage space it has taken up so far. Perhaps due to documents uploaded, list items added, so on... – Indra Jun 03 '10 at 11:12

2 Answers2

0

You can see the size (in bytes) opening Sharepoint 2010 Management Shell (run it with as Administrator) and execute:

> Start-SPAssignment -Global
> (Get-SPSiteAdministration -Identity http://YourSharePointURL/urlToYourSite/).DiskUsed

Also, you would like to know each subsite size. To do that, run the following script under the Sharepoint Management Shell:

function GetWebSizes ($StartWeb)
{
    $web = Get-SPWeb $StartWeb
    [long]$total = 0
    $total += GetWebSize -Web $web
    $total += GetSubWebSizes -Web $web
    $totalInMb = ($total/1024)/1024
    $totalInMb = "{0:N2}" -f $totalInMb
    $totalInGb = (($total/1024)/1024)/1024
    $totalInGb = "{0:N2}" -f $totalInGb
    write-host "Total size of all sites below" $StartWeb "is" $total "Bytes,"
    write-host "which is" $totalInMb "MB or" $totalInGb "GB"
    $web.Dispose()
}

function GetWebSize ($Web)
{
    [long]$subtotal = 0
    foreach ($folder in $Web.Folders)
    {
        $subtotal += GetFolderSize -Folder $folder
    }
    write-host "Site" $Web.Title "is" $subtotal "KB"
    return $subtotal
}

function GetSubWebSizes ($Web)
{
    [long]$subtotal = 0
    foreach ($subweb in $Web.GetSubwebsForCurrentUser())
    {
        [long]$webtotal = 0
        foreach ($folder in $subweb.Folders)
        {
            $webtotal += GetFolderSize -Folder $folder
        }
        write-host "Site" $subweb.Title "is" $webtotal "Bytes"
        $subtotal += $webtotal
        $subtotal += GetSubWebSizes -Web $subweb
    }
    return $subtotal
}

function GetFolderSize ($Folder)
{
    [long]$folderSize = 0 
    foreach ($file in $Folder.Files)
    {
        $folderSize += $file.Length;
    }
    foreach ($fd in $Folder.SubFolders)
    {
        $folderSize += GetFolderSize -Folder $fd
    }
    return $folderSize
}

Then:

GetWebSizes -StartWeb <startURL>

I hope this will help you... :)

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

TanisDLJ
  • 966
  • 1
  • 12
  • 16
0

All content for SharePoint is stored in Content Database (unless you are using some sort of 3rd party external BLOB provider).

A site collection (aka top level site) is stored in a single content database but each content database can have multiple site collections.

These are going to give slightly different results -e.g. one is looking at the size of documents stored, the other is the size of the content database storing those documents. None of these is going to include the files in C:\Inetpub\wwwroot\wss\VirtualDirectories\80 or C:\Program Files\Common Files\Microsoft Shared\web server extensions\12 but these are nearly always insignificant compared to the size of the documents stored in SharePoint.

Community
  • 1
  • 1
Ryan
  • 23,871
  • 24
  • 86
  • 132