Follow Us:
When considering an upgrade to a SharePoint environment, one of the first question people ask is "What do I have to do?"
Upgrading to a newer version can be tedious, especially if your current environment is heavily used and contains a variety of site templates or lots of data. I have done several migration projects in the past year and found there are three questions you should always ask before you start.
PowerShell Solutions
Here are two PowerShell scripts that you can perform to output some general information about your current environment. The first script will generate a report that lists all the site(s) and the site template that was used when the site was created. The second script generates a report on how much space is being used.
Site Hierarchy and Site Templates code snippet
#add header to file
"Site Collection URL,Web URL,Web Title,Web Template" | out-file "c:\SP_Webs.csv" -append
#Iterate through the web applications
foreach ($site in get-spsite) {
write-host $site.url
#Iterate through all the sites within the current web application
foreach ($web in $site.AllWebs){
$siteUrl = $site.url
$webUrl = $web.url
$webTitle = $web.Title
$webTemp = $web.WebTemplate
#output the info to a file
"$siteUrl,$weburl,$webTitle,$webTemp" | out-file "c:\SP_Webs.csv" -append
}
Current data storage size code snippet
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)
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
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
Save the above script to filename “GetWebSizes.ps1” then execute the following PowerShell command:
GetWebSizes -StartWeb <StartURL>
For more information on C5 Insight or this blog entry, please Contact Us.
The complementary paper includes over 12 years of research, recent survey results, and CRM turnaround success stories.
Request Download
This 60-second assessment is designed to evaluate your organization's collaboration readiness.
Learn how you rank compared to organizations typically in years 1 to 5 of implementation - and which areas to focus on to improve.
This is a sandbox solution which can be activated per site collection to allow you to easily collect feedback from users into a custom Feedback list.
Whether you are upgrading to SharePoint Online, 2010, 2013 or the latest 2016, this checklist contains everything you need to know for a successful transition.