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
stsadm -o provisionservice -action start -servicetype spwebservice
- Starts or stops the SPService
- We can get list of all services using Enumservices Stsadm operation
- Reference : https://documentation.help/Stsadm/20728380-0d5e-4417-aa01-450259d8a068.htm
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

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
- Enlist the sites in a web application
- One of the scenario is to know the locked state of sites
- Reference – https://docs.microsoft.com/en-us/previous-versions/office/sharepoint-2007-products-and-technologies/cc262492(v=office.12)
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
- Add SharePoint solution to the Farm
- Reference : https://docs.microsoft.com/en-us/powershell/module/sharepoint-server/add-spsolution?view=sharepoint-ps
Install-SPSolution
- Delpoy the added SharePoint solution in the farm
- Reference : https://docs.microsoft.com/en-us/powershell/module/sharepoint-server/install-spsolution?view=sharepoint-ps
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 🙂
You must log in to post a comment.