SharePoint Migration – Large List Details

This is article is next in the series of articles on “SharePoint Migration & Planning” Strategies. You can reach out to the previous articles in this series using the following links:

SharePoint Migration: Planning & Guidance On SharePoint Objects
SharePoint Migration – Export IIS Settings
SharePoint Migration – Export Alternate Access Mapping
SharePoint Migration – Export Content Database Details

In this article we will look for the PowerShell Scripts to export “SharePoint Large Lists” Report from source SharePoint Farm. This information will be helpful to track all the lists which contains more than “2000” items in it and provisioned in SharePoint Farm.

In Step 1 we will add the PowerShell Snapin to PowerShell Script as usual.

1

In Step 2 we define a function and initiate the export CSV file with Column Headers. For this demo I am exporting a few important properties like “WebApp Name, WebApp Url, Site Collection Url, Site Name, Site URL, List Name, List Item Count” but you may query all possible properties as you deemed fit

In Step 3 we execute the “Get-SPWebApplication” cmdlet to query the “Sites” & “Webs” Properties

In Step 4 we loop through the Sites Collection for a specific Web Application

In Step 5 we loop through the Webs Collection for a specific Site

In Step 6 we loop through the Lists Collection for a specific Web

In Step 7 we will filter all those lists which are having over “2000” items in them

In Step 8 we add the content of properties for each of the list to the CSV file

Always remember to dispose SharePoint Site & Web objects to avoid memory leaks. In Step 9 we will call the “dispose()” method

2

In Step 10 we will initialize path variables for export file & web applications. You can further extend this step by adding little bit of more automation flavor to make it more dynamic by reading parameters from input settings file

3

Once this script get executed successfully, it will export the Large List Details in a CSV File as shown below in Step 11

4

We can see the exported details as shown below in Step 12

5

Code Reference:

Add-PSSnapin "Microsoft.SharePoint.PowerShell"Add-PSSnapin "Microsoft.SharePoint.PowerShell"
function Get-Large-List-Report(){ Try {        if (Test-Path $settingsFilePath)        {            Remove-Item $settingsFilePath        }
        Add-Content $settingsFilePath "WebApp Name,WebApp Url,Site Collection Url,Site Name,Site URL,List Name,List Item Count"
        $spWebApplication = Get-SPWebapplication $webApplicationUrl
        foreach($spSite in $spWebApplication.sites)        {            foreach($spWeb in $spSite.AllWebs)            {                foreach($spList in $spWeb.Lists)                {                    if($spList.ItemCount -gt 2000)                    {                        $content = $spWebApplication.Name + "," + $spWebApplication.Url + "," + $spSite.Url + "," + $spWeb.Title + "," + $spWeb.Url + "," + $spList.Title + "," +  $spList.ItemCount                        Add-content $settingsFilePath $content                    }                }                $spWeb.dispose()            }            $spSite.dispose()        }    }    Catch {         Write-Host $Error -ForegroundColor Yellow }}
Clear-Host
$settingsFilePath = "<CSV File Path>"$webApplicationUrl = "<Web Application Url>"
Get-Large-List-Report

That is all for this demo.

Hope you find it helpful.

Advertisements

SharePoint Migration – Export Content Database Details

This is article is next in the series of articles on “SharePoint Migration & Planning” Strategies. You can reach out to the previous articles in this series using the following links:

SharePoint Migration: Planning & Guidance On SharePoint Objects
SharePoint Migration – Export IIS Settings
SharePoint Migration – Export Alternate Access Mapping

In this article we will look for the PowerShell Scripts to export “SharePoint Content Databases” details from source SharePoint Farm. This information will be helpful to track all the “Content Databases” provisioned in SharePoint Farm.

In Step 1 we will add the PowerShell Snapin to PowerShell Script as usual

1

In Step 2 we define a function and initiate the export CSV file with Column Headers. For this demo I am exporting a few important properties like “Id, Content Database Name, Web Application Name, Server Name, Current Site Count” but you may query all possible properties as you deemed fit

In Step 3 we execute the “Get-SPContentDatabase” cmdlet to query the required properties

In Step 4 we loop through the properties collection for all Content Databases and list out the queried properties for each database

In Step 5 we add the content of properties for each of the Content Database to the CSV file

2

In Step 6 we will set the settings file path and call the function to export the Content Database Details

3

Once this script get executed successfully, it will export the Content Database Details in a CSV File as shown below in Step 7

4

We can see the exported details as shown below in Step 8

5

Code Reference:

Add-PSSnapin "Microsoft.SharePoint.PowerShell"Add-PSSnapin "Microsoft.SharePoint.PowerShell"
function Get-Content-Databases(){ Try {        if (Test-Path $settingsFilePath)        {            Remove-Item $settingsFilePath        }
        Add-Content $settingsFilePath "Id,Content Database Name,web Application Name,Server Name,Current Site Count"
        $contentDBSettings = Get-SPContentDatabase | Select Id,Name,webApplication,Server,CurrentSiteCount
        foreach ($contentDBSetting in $contentDBSettings)        {            $id = $contentDBSetting.Id            $name = $contentDBSetting.Name            $webApplication = $contentDBSetting.webApplication            $server = $contentDBSetting.Server            $currentSiteCount = $contentDBSetting.CurrentSiteCount
            $settings = "$id,$name,$webApplication,$server,$currentSiteCount"             Add-content $settingsFilePath $settings        }    }    Catch {         Write-Host $Error -ForegroundColor Yellow }}
Clear-Host
$settingsFilePath = "<CSV File Path>"
Get-Content-Databases

That is all for this demo.

Hope you find it helpful.

 

 

 

 

SHAREPOINT MIGRATION – EXPORT Alternate Access Mapping

This is article is next in the series of articles on “SharePoint Migration & Planning” Strategies. You can reach out to the previous articles in this series using the following links:

  1. SHAREPOINT MIGRATION: PLANNING & GUIDANCE ON SHAREPOINT OBJECTS
  2. SHAREPOINT MIGRATION – EXPORT IIS SETTINGS

In this article we will look for the PowerShell Scripts to export “Alternate Access Mapping (AAMs)” Settings from source SharePoint Farm. This information will be helpful to track all the “AAMs” defined in SharePoint Farm.

In Step 1 we will add the PowerShell Snapin to PowerShell Script as usual

1

In Step 2 we define a function and initiate the export CSV file with Column Headers. For this demo I am exporting a few important properties like “Incoming Url, Zone, Public Url” but you may query all possible properties as you deemed fit

In Step 3 we execute the “Get-SPAlternateURL” cmdlet to query the required properties

In Step 4 we loop through the properties collection for all AAM Mapping and list out the queried properties for each mapping

In Step 5 we add the content of properties for each of the AAM Mapping to the CSV file

2

In Step 6 we will set the settings file path and call the function to export the AAM Mappings

3

Once this script get executed successfully, it will export the AAM Mappings in a CSV File as shown below in Step 7

4

We can see the exported mappings as shown below in Step 8

5

Code Reference:

Add-PSSnapin "Microsoft.SharePoint.PowerShell"Add-PSSnapin "Microsoft.SharePoint.PowerShell"
function Get-Alternate-Access-URLs(){ Try {        if (Test-Path $settingsFilePath)        {            Remove-Item $settingsFilePath        }
        Add-Content $settingsFilePath "Incoming Url, Zone, Public Url"
        $aamSettings = Get-SPAlternateURL | Select IncomingUrl,Zone,PublicUrl
        foreach ($aamSetting in $aamSettings)        {            $incomingUrl = $aamSetting.IncomingUrl            $zone = $aamSetting.Zone            $publicUrl = $aamSetting.PublicUrl
            $settings = "$incomingUrl, $zone, $publicUrl"             Add-content $settingsFilePath $settings        }    }    Catch {         Write-Host $Error -ForegroundColor Yellow }}
Clear-Host
$settingsFilePath = "C:\Prashant\PowerShell\SharePoint Migration\PowerShell - Get-Alternate-Access-URLs\Alternate-Access-Urls.csv"
Get-Alternate-Access-URLs

That is all for this demo.

Hope you find it helpful.

SharePoint Migration – Export IIS Settings

This is article is next in the series of articles on “SharePoint Migration & Planning” Strategies. You can reach out to the previous articles in this series using the following links:

SharePoint Migration: Planning & Guidance On SharePoint Objects

In this article we will look for the PowerShell Scripts to export IIS Settings from source SharePoint Farm. This information will be helpful to track all the “Application Pool” accounts used to configure Web Applications in the Farm.

There could be more properties that you can export but for this demo I am considering following important properties:

Site Name, Site Path, Application Pool, Bindings, Identity, Password

In Step 1 we will import module “WebAdministration” which gives us the methods to work with “IIS Manager” Objects

1

In Step 2 we will retrieve items from IIS directory using wildcard path search “IIS:\Sites\*”

In Step 3 we will enlist the header of the output Settings file by using the name of properties that we are pulling from IIS

In Step 4 we will fetch properties “Site Name, Site Path, Application Pool, Bindings, Identity, Password” for each IIS Site

In Step 5 we will append the properties to the output file for each of the IIS sites we have in Farm

2

In Step 6 we are specifying the path for output file which would be in the form of CSV

In Step 7 we are calling the function executing Step 1-6

3

Once the script executed successfully it will generate the output file as shown below-

4

And here is the data that was added to the output file during the execution of the above script

We can see IIS details for each Site (Web Application) added to the SharePoint Farm and this information is really crucial to document during the Migration planning phase.

5

Code Reference:

Import-Module WebAdministration
function Get-IIS-Settings(){    param($ListName,$ScriptPath,$FileDateTimeStamp) Try {        if (Test-Path $settingsFilePath)        {            Remove-Item $settingsFilePath        }
        $iisSites = Get-Item IIS:\Sites\*
        Add-Content $settingsFilePath "Site Name , Site Path , Application Pool , Bindings , Identity , Password"
        foreach ($iisSite in $iisSites)        {            $appPoolName = $iisSite.ApplicationPool            $appPool = get-item "IIS:\AppPools\$appPoolName"            $processModel = $appPool.processModel            $appPoolIdentity = $processModel.username            $appPoolIdentityPassword = $processModel.password            $iisBindings = $iisSite.Bindings            $iisBindingCollection = $iisBindings.Collection             $siteName = $iisSite.Name            $sitePath = $iisSite.physicalPath
            $settings = "$siteName, $sitePath, $appPoolName,$iisBindingCollection,$appPoolIdentity, $appPoolIdentityPassword"             Add-content $settingsFilePath $settings        }
    }    Catch {         Write-Host $Error -ForegroundColor Yellow }}
Clear-Host
$settingsFilePath = "C:\Prashant\PowerShell\SharePoint Migration\IISSettings.csv"
Get-IIS-Settings

Hope you find it helpful.

SharePoint Migration: Planning & Guidance on SharePoint Objects

1

While performing SharePoint Migration we need to do lot of planning before actually starting even with the basic step on migration.

Planning includes well defined list of SharePoint Artifacts, Settings, or Configurations that must be identified beforehand and accordingly migration strategy can be worked out.

SharePoint Migration involves the following stages:

  • Inventory Audits
  • Configuration Migration
  • Schema Migration
  • Data Migration
  • Validation

In this article I will explain you detailed list of SharePoint Inventory that must be pulled out and kept stored as backup safely atleast during the migration phase.

 SharePoint Inventory Map

Below is the small Inventory Map for SharePoint Objects & Artifacts that we should always consider during the Planning Phase for SharePoint Migration.

In the upcoming sections of this article we discuss each of the Object/Artifact in more details from data collection stand point.

2

SharePoint Objects & Properties

Here is list of objects that should be queried during the initiation phase of migration.

SharePoint Farm

We should query SharePoint Farm Object to get it Properties, Configurations settings, Level of SharePoint Logging and Server details which are associated to this farm

 

3

Configuration & Settings

We should query SharePoint to get configuration settings for IIS, SharePoint Designer, Alternate Access and Common Web Service (SPServiceHostConfig)

4

Databases

We should query SharePoint to get details on databases designated as Content & Configuration databases associated with current Farm

5

Web Application, Sites, (Site Map)

We should query SharePoint to get details on Web Applications, Site Collections, Sites Subsites (Site Map), Site Templates especially the custom templates if you want to have sites based on these custom templates at destination too

6

Lists & Libraries

We should query SharePoint to get details on List Schema, Item Count, List Permissions, Item Specific Permissions if any and also report of large lists. This information will very helpful while migrating Schema & data at later stage of Migration process

7

Accounts, Authentication & Claim Providers

We should query SharePoint to get details on Managed Accounts, Application Pool Accounts, Authentication Providers and Installed Certificates Information.

8

Custom Solutions

We should query SharePoint to get details on custom WebParts, Features, Time Jobs, Layout Pages and other solutions (WSPs). This information is really important to migrate or rewrite functionalities as deemed fit. We also need to gather source code for each of the custom solutions as it might be required during migration issues encountered during/after migration.

9

Service Applications

We should query SharePoint to get details on Service Applications, Application Instances, Load Balancer Configuration. Information on Server Applications is important to help understand and troubleshoot issues during/after migration

10

Business Connectivity Service Applications

We should query SharePoint to get details on configuration settings for BCS data connection files. This will be really important to know all connection details for LOBs connected using BCS.

11

Search Service Applications

Search is one of the most complex Service applications when it comes to migration. So it really important that we should detailed out each granular piece of information associated with Search service applications.

We should query SharePoint to get details on configuration settings for Search Service Applications, Query Keywords, Query Scope, Query Rules, Query Suggestion, Ranking Model, Security Trimmer, and Application Proxies.

12

Application Specific Properties & Settings for Service Applications

Most Service applications expose a set of properties specific to each of them. It is important detailed out all possible details on each of application specific properties that we can query from SharePoint as shown below

13

I will keep on updating this article as I get more relevant information to include so that it could be proved as one stop reference for SharePoint Migration Guidance.

In the upcoming articles on SharePoint Migration I will show you implementation details on how to gather the inventory for each of the above mention objects.

So stay tuned.

Hope you find it helpful.