How to rename SharePoint_AdminContent Database

Categories: PowerShell, SharePoint
##How to rename SharePoint_AdminContent_<GUID> Database
##Use SharePoint 2013 Management Shell
##Set the New Database Name and set the Central Administration URL
$NewDatabaseName = 'SharePoint_AdminContent'
$URLCentralAdministration = 'http://server:port'

$OldDatabaseDetails=Get-SPWebApplication –Identity $URLCentralAdministration | Get-SPContentDatabase
New-SPContentDatabase –Name $NewDatabaseName –WebApplication $URLCentralAdministration
$NewDatabaseDetails=Get-SPWebApplication -Identity $URLCentralAdministration | Get-SPContentDatabase | Where-Object {$_.Name -eq $NewDatabaseName}
Get-SPSite –ContentDatabase $OldDatabaseDetails.Id | Move-SPSite –DestinationDatabase $NewDatabaseDetails.ID -confirm:$false
cd $env:SystemRoot\system32
./iisreset.exe
Remove-SPContentDatabase $OldDatabaseDetails.Id -force -confirm:$false
«
»

    Leave a Reply

    Your email address will not be published. Required fields are marked *

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