move site collection to dedicate content database

We have to move site collection to dedicate content database when content database size growing too large. One content database present under a web application in SharePoint contains multiple site collections. We can create or add new content databases under web application when limit of maximum number of sites that can be created in this database exceed while creating new site collection. If one site collection present under a content database is growing large, user request to create a dedicate content database and move that particular site collection to another new content database. We need to follow the steps as described below to move site collection to dedicate content database.

Advertisements
  1. Get site collection GUID using powershell
  2. Get which content database site collection web application is stored
  3. Create new content database in SharePoint
  4. move site collection to different content database
  5. IISRESET SharePoint server
  6. Post Implementation testing
Advertisements

Get site collection GUID using powershell

Before you move site collection to another content database, get guid of sharepoint site. You can get site collection guid using powershell script as mentioned below.

$site=Get-SPSite http://win-q2repghf9du/sites/TeamSiteClassicRenamed
$siteguid=$site.id
echo $siteguid
get site collection guid powershell
Advertisements

Get which content database site collection web application is stored

Get site collection content database details including web application, site url using the powershell command below.

Get-SPSite | Where-Object {$_.Url -like "http://win-q2repghf9du/sites/TeamSiteClassicRenamed"} | select Url, ContentDatabase, WebApplication
content database in which site collection is stored

You can use the alternative command as described in my old post link below.

https://atomic-temporary-119393429.wpcomstaging.com/content-database-in-sharepoint/
Advertisements
Advertisements

Create new content database in SharePoint

I described in detail about how to create or add a new content database in SharePoint in my previous post. Follow the post linked below for more details and use the powershell script for creating content database.

https://sharepointtechnicalsupport.com/create-add-a-content-database-in-sharepoint-2019/
New-SPContentDatabase "WSS_Content_DB2" -DatabaseServer "WIN-Q2REPGHF9DU" -WebApplication http://win-q2repghf9du/ -MaxSiteCount 1 -WarningSiteCount 0
Create new content database in sharepoint using powershell
Advertisements
Advertisements
Content database in sql server
Advertisements

move site collection to different content database

Now we are ready to move site collections between databases using the powershell command Move-SPSite as described below.

Move-SPSite "http://win-q2repghf9du/sites/TeamSiteClassicRenamed" -DestinationDatabase "WSS_Content_DB2"
move site collection to dedicate content database
Advertisements
Advertisements

IISRESET SharePoint server

You will get a message in powershell window like “IIS must be restarted before this change will take effect. To restart IIS, open a command prompt window and type iisreset”. You have to do IIS reset SharePoint server.

iisreset
iisreset sharepoint server
Advertisements
Advertisements

Post Implementation testing

After move site collection to new content database completed, you can check GUID of the site collection again. Its same as source location.

check guid of site in sharepoint

check content database of site collection to cross check the new content database as destination location.

check content database of site collection
Advertisements
Advertisements
Advertisements
Advertisements

security group in active directory creation

security group in active directory, you can create when you plan to manage permission in sharepoint from AD end. This provides additional security, tracking, control and manage permission for the secure contents present in sharpeoint sites. You need to create AD groups of type security in domain controller in windows server 2019. Then add security group to sharepoint site by following the option “Grant Permissions” from ribbon.

Advertisements

Types of group scopes

There are three group scopes like Domain local, Global, Universal.

Types of active directory groups

There are two types of AD groups like Security Groups, Distribution Groups.

Real world situation, there are dedicated organizational unit or we call as OU unit where groups are created. Here i am focusing on creating AD group. Follow the step by step process described in this post and understand how to create security group in AD with global group scope.

Advertisements
  • Open “Active Directory Users and Computers” from start menu or following dsa.msc snap in windows server 2019.
  • Right click on “OU”, navigate to “New” and select “Group” to create AD group.
Create new group active directory users and computers
Advertisements
  • Enter AD group name, select group scope as “Global”, select group type as “Security” and click on “OK” to apply changes.
security group type global group scope
Advertisements
  • Active directory group is created. Right click on the group, select “Properties”.
security group type global group scope properties
Advertisements
  • Clcik on global security group properties general to see details in it.
global security group properties general
Advertisements
  • Global security group properties Memebrs to add users to the group created.Click on “Add” to add users.
global security group properties members
Advertisements
  • “Members Of” properties to see this group is part of any other group.
global security group properties member of
Advertisements
  • global security group properties security to check oermission of this group. You can check in , check out box to edit or modify changes.
global security group properties security
Advertisements
  • managed by group property can find details as below.
global security group properties managed by
Advertisements
  • global security group properties object will display details as below.
global security group properties object
Advertisements

Powershell to create security group in active directory

We can create security group in active directory using powershell command New-ADGroup as well so as to make it quick.

New-ADGroup -DisplayName "SPMCSE-Owners" -GroupScope DomainLocal -Name "SPMCSE-Owners"
New-ADGroup -DisplayName "SPMCSE-Contributor" -GroupScope DomainLocal -Name "SPMCSE-Contributor"
New-ADGroup -DisplayName "SPMCSE-Reader" -GroupScope DomainLocal -Name "SPMCSE-Reader"
New-ADGroup -DisplayName "SPMCSE-ViewOnly" -GroupScope DomainLocal -Name "SPMCSE-ViewOnly"
Advertisements
Powershell to create security group in active directory
Advertisements
Advertisements
Advertisements

create fast site collection in sharepoint 2019

create fast site collection is a new feature introduced in SharePoint 2019. Create a new site time can be reduced to half compared to New-SPSite PowerShell cmdlet by this feature. This fast site creation feature operates directly at the DB level, witpout passing to Object Model, and saving several round trips between database server and sharepoint server. So in this post we will discuss all about how to create site collection using fast site creation feature in sharepoint 2019.

Advertisements

Each site collection is associated with a blank template called a “site master”. Creating fast site, actually copies that site from DB and copies to destination site.

Fast site creation is supported with below site templates only.

You can follow my post Get template id sharepoint site with powershell to get list of templates in sharepoint 2019.

Fast creation enabled site collection templates can get using the powershell cmdlet Get-SPWebTemplatesEnabledForSiteMaster

Advertisements

Get-SPWebTemplatesEnabledForSiteMaster

Get-SPWebTemplatesEnabledForSiteMaster
Site collection templates that are fast site creation enabled
Advertisements

Disable-SPWebTemplateForSiteMaster

Powershell command to disable site template, enabled to create fast site collection is Disable-SPWebTemplateForSiteMaster.

Disable-SPWebTemplateForSiteMaster -Template STS#3
Disable-SPWebTemplateForSiteMaster
Advertisements

Enable-SPWebTemplateForSiteMaster

Powershell command to enable site template for fast site creation is Enable-SPWebTemplateForSiteMaster.

Enable-SPWebTemplateForSiteMaster -Template STS#3
Enable-SPWebTemplateForSiteMaster
Advertisements

New-SPSiteMaster

We can create a new Site Master using a site template by powershell command New-SPSiteMaster.

New-SPSiteMaster -Template STS#3 -ContentDatabase "WSS_Content_44179"
site master dbo.SIteMasters fast site creation sharepoint 2019
Advertisements

Site Master id stored table in content database sql server

SIte master created is actually stored in content database sql server database. We can open sql db, expand the contnet database, expand and identify the table dbo.SiteMasters.

dbo.SiteMasters
Advertisements

Get-SPSiteMaster

This PowerShell cmdlet Get-SPSiteMaster returns a reference to the site master associated with a content database.

Get-SPSiteMaster -ContentDatabase "WSS_Content_44179"
site master associated with content database
Advertisements

Remove-SPSiteMaster

This PowerShell cmdlet Remove-SPSiteMaster deletes site master from content database.

Remove-SPSiteMaster -ContentDatabase "WSS_Content" -Siteid "2a534455-1369-4f1e-bcf9-7e3feaf2a801"
Remove-SPSiteMaster Confirmation
Remove-SPSiteMaster
Advertisements

Fast site creation using powershell in a content database

we can use below powershell command to create fast site using site master present under a content database.

New-SPSite http://win-q2repghf9du:44179/sites/SharePointTech -Template "STS#0" -ContentDatabase "WSS_Content_44179" -OwnerAlias "SPMCSE\Administrator" -CreateFromSiteMaster
create fast site collection New-SPSite
Advertisements
Advertisements