Rename Central Admin Database

If you had ran Configuration Wizard to create your SharePoint Farm then your Admin Content database will have AdminContent_XXX-XXXX-XXXXX (Guid) in its name.  If you want to fix it, so you SQL Management studio looks good and no one actually blames you to be a bad SharePoint Admin, you can use the script below.

Add-PSSnapin Microsoft.SharePoint.Powershell -ErrorAction SilentlyContinue
#List all web applications
Get-SPWebApplication -IncludeCentralAdministration

$CentralAdminUrl = "http://sp2013:2013/"
$CentralAdminDB = Get-SPContentDatabase -WebApplication $CentralAdminUrl
#Verify the database object is good

#New DB Name
$NewCentralAdminDBName = "01_Content_NewCentralAdmin"
$NewCentralAdminContentDB = New-SPContentDatabase -Name $NewCentralAdminDBName -WebApplication $CentralAdminUrl -MaxSiteCount 2 -WarningSiteCount 1
#Verify the database is added
Get-SPContentDatabase -WebApplication $CentralAdminUrl
#Verify the database object is good 
#Move the Sites to nicely named DB
$CentralAdminDB.Sites | % {Move-SPSite $_ -DestinationDatabase $NewCentralAdminContentDB -Confirm:$false -Verbose}
#Verify the Site collection are moved
Get-SPContentDatabase -WebApplication $CentralAdminUrl
#If databases are moved then dismount the orignal DB

Dismount-SPContentDatabase $CentralAdminDB -Confirm:$false -Verbose
#Confirm First Database is gone
Get-SPContentDatabase -WebApplication $CentralAdminUrl
#Delete the database from SQL Server 

7 thoughts on “Rename Central Admin Database

  1. Hmm, I thought I’d try this with the new SP2016 and received the following error. “Move-SPSite Cannot complete the copy or merge operation because the database schema versions are different and Clearly they are the same, but the commandlet doesn’t think so. Hopefully MS fixes this.


    1. I only tried this in 2013 but not 2016 but I know there is a bug in 2016 which does not upgrade the schema of 2016 Content Database. I am testing it right now. Can you please try to upgrade both content databases using Upgrade-SPContentDatabase cmdlet. You can also see the Database status from Upgrade and Migration page in CA.

  2. I was doing that as you were typing your response. That command would not work. It couldn’t find the new Database even though it was listed in the Content Databases screen. I then realized I had not installed the SP2016 RC Patch that just recently came out. Installed the patch and re-ran your PowerShell script and “Ta Da” it worked !!!


  3. Hi,

    Just so you know it is the opposite to what you would expect and is confirmed as per Jerry’s advice. If you do not want to do the patch, you can just perform Upgrade-SPContentDatabase against the original GUID based DB. Whereas personally and without looking you would be gunning for the newly created DB.


  4. Has anyone tried this in SP 2019. I get the error “Move-SPSite Cannot complete the copy or merge operation because the database schema versions are different” and when i try to upgrade the database, it says it doesnt need an upgrade.
    any help is appreciated.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s