SharePoint On-Premises to On-Premises migration – Important PowerShell CMDLETS / STSADM operations at one place – Part 2

Hi All,

Greetings for the day 🙂 LIFE IS BEAUTIFUL 🙂

Since nowadays working on SharePoint migration projects, lots of use of POWERSHELL CMDLETS using/learning. So sharing those.

In previous article we shared few important required POWERSHELL CMDLETS. – SharePoint On-premises to On-premises migration – Important PowerShell commands at one place – Part 1

Today sharing few more 🙂

stsadm -o provisionservice

Important CMDLET required in SharePoint Migration - executing stsadm -o provisionservice
Fig : Important CMDLET required in SharePoint Migration – executing stsadm -o provisionservice
stsadm -o provisionservice -action start -servicetype spwebservice

Get all site collections associated with respective content database

  • Scenario : We are migrating MOSS (SharePoint 20070) application SharePoint 2016
    • We are using content database attach method
    • Our MOSS web application has 10 content database attached
    • We are done with mounting 9 databases and forget one
    • We did visual upgrade to all site collections
    • Now while verifying sites we realized that we missed one DB and respective site collections from it
    • So we tested, mounted the remaining database but since we are multiple databases and huge number of site collections its difficult to find site collections remaining to verify from the respective database
  • So here, requirement is to get all the site collections from the given database
  • So, Get-SPSite command is for our help
PS C:\> $sites = Get-SPSite -ContentDatabase <"My Database Name">
PS C:\> $sites

Url
---
http://knowledgejunction.sharepoint.com/sites/site1
http://knowledgejunction.sharepoint.com/sites/site2

View the status of current user interface of Site

PS C:\> $site = Get-SPSite "http://knowledgejunction.sharepoint.com/sites/knowledgejunction/"

PS C:\> $site.GetVisualReport()

SitePath                      : /sites/knowledgejunction
WebPath                       : /sites/knowledgejunction
UIVersion                     : 15
UIVersionConfigurationEnabled : False
MasterUrl                     : /sites/knowledgejunction/_catalogs/masterpage/seattle.master
CustomMasterUrl               : /sites/knowledgejunction/_catalogs/masterpage/seattle.master

SitePath                      : /sites/knowledgejunction
WebPath                       : /sites/knowledgejunction/sharepoint
UIVersion                     : 15
UIVersionConfigurationEnabled : False
MasterUrl                     : /sites/knowledgejunction/sharepoint/_catalogs/masterpage/seattle.master
CustomMasterUrl               : /sites/knowledgejunction/sharepoint/_catalogs/masterpage/seattle.master
Important CMDLET required in SharePoint Migration - getting visual upgrade report for the respective site
Fig : Important CMDLET required in SharePoint Migration – getting visual upgrade report for the respective site

Convert users from classic mode authentication to claim based – WebApplication.MigrateUsers()

 $webApp = Get-SPWebApplication <"My Webapplication URL">
 $webApp.MigrateUsers($true)

OR

Convert-SPWebApplication -Identity "your-web-application-url" -To Claims  -RetainPermissions

Upgrade-SPContentDatabase

  • Upgrades the attached content database scema in the farm
  • Database upgrade dosent update the compability of site collections in the database
Upgrade-SPContentDatabase <Content DB>

stsadm -o enumsites

stsadm.exe -o enumsites -url <virtual server URL> -showlocks -redirectedsites

  • It returns result as follows
<Sites Count="44">
  <Site Url="http://knowledgejunction.sharepoint.com" Owner="KnowledgeJunction\prasham" SecondaryOwner="KnowledgeJunction\prasham" ContentDatabase="knowledgejunction" Lock="readonly" StorageUsedMB="1429133.1" StorageWarningMB="0" StorageMaxMB="0" />

  <Site Url="http://knowledgejunction.sharepoint.com" Owner="KnowledgeJunction\prasham" ContentDatabase="knowledgejunction" Lock="readonly" StorageUsedMB="144.1" StorageWarningMB="8000" StorageMaxMB="10240" />

  <Site Url="http://knowledgejunction.sharepoint.com" Owner="KnowledgeJunction\prasham" SecondaryOwner="KnowledgeJunction\prasham" ContentDatabase="knowledgejunction" Lock="noaccess" StorageUsedMB="24.9" StorageWarningMB="8000" StorageMaxMB="10240" />

  <Site Url="http://knowledgejunction.sharepoint.com" Owner="KnowledgeJunction\prasham" SecondaryOwner="KnowledgeJunction\prasham" ContentDatabase="knowledgejunction" Lock="none" StorageUsedMB="9870.5" StorageWarningMB="25000" StorageMaxMB="30000" />
</Sites>

Add-SPSolution

Important CMDLET for migration - Add-SPSolution
Fig : Important CMDLET for migration – Add-SPSolution

Install-SPSolution

Important CMDLET for migration - Install-SPSolution
Fig : Important CMDLET for migration – Install-SPSolution

Thanks for reading 🙂 If its worth at least reading once, kindly please like and share 🙂 SHARING IS CARING 🙂

Enjoy the beautiful life 🙂 Have a FUN 🙂 HAVE A SAFE LIFE 🙂 TAKE CARE 🙂

Prasham Sabadra

LIFE IS VERY BEAUTIFUL :) ENJOY THE WHOLE JOURNEY :) Founder of Knowledge Junction and live-beautiful-life.com, Author, Learner, Passionate Techie, avid reader. Certified Professional Workshop Facilitator / Public Speaker. Scrum Foundation Professional certificated. Motivational, Behavioral , Technical speaker. Speaks in various events including SharePoint Saturdays, Boot camps, Collages / Schools, local chapter. Can reach me for Microsoft 365, Azure, DevOps, SharePoint, Teams, Power Platform, JavaScript.

You may also like...

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: