How to Rename SharePoint 2013 Central Admin Database to Remove GUID?

When you run the SharePoint products configuration wizard right after installing SharePoint binaries, it creates a SharePoint central administration database with GUIDs. E.g. SharePoint_AdminContent_a149fa83-d2b9-4ad9-9e4c-ad12f73f0dd6.

Your DBA’s may not be happy with these GUIDs as they deviate from database naming standards. So, let’s rename the SharePoint Central administration content database with the following steps:

sharepoint admin content database guid
Always, remember to back up SharePoint Central Admin database prior to performing these steps.

Here is how to remove GUID from SharePoint 2013 Central Admin database in three simple steps:

Step 1. Detach Central Admin Content Database:

Detach Central Admin Content Database: (PowerShell: Dismount-SPContentDatabase)

stsadm -o deletecontentdb -url https://centraladmin:2013 -databasename SharePoint_AdminContent_a149fa83-d2b9-4ad9-9e4c-ad12f73f0dd6 -databaseserver SP13_SQL

Step 2. Rename the Content Database from SQL Server

Right-click the database, Choose Properties, Select the Options tab. Set the database restricted access property to “Single User Mode”. Rename the database by removing GUID from it (Right-click the database, choose “Rename”). Now, set the database restricted access back to “Multi-User”.
sharepoint 2013 database names guid

Step 3. Attach the renamed Content Database

Attach the renamed content database back to the Central Administration web application: (PowerShell: Mount-SPContentDatabase)

stsadm -o addcontentdb -url https://centraladmin:2013 -databasename SharePoint_AdminContent 

How to Rename SharePoint 2013 Central Admin Database to Remove GUID?

An alternate approach to rename the SharePoint database:

Alternatively, You can create a new content database with the right naming conventions, move all sites from the existing content database to the new one, and then remove the old one. Here is the script:

#Create new Content Database
New-SPContentDatabase -Name SharePoint_AdminContent -WebApplication https://centraladmin:2013

Now the Central Admin should have two databases attached with it.

sharepoint admin content database guid

Let’s get the IDs of those two databases:

# Get SharePoint database IDs for old and new DBs for central admin site
Get-SPWebApplication -Identity https://centraladmin:2013 | Get-SPContentDatabase | SELECT ID, Name, WebApplication | Format-List

#Note down the IDs of Original Database and New Database. 
# In my case, Old database id: c87506a9-b87d-40b8-9582-aac9ee89c8f8.  
# New Database id: 8f35dc3b-56ab-45df-a1cf-459b60aa7454
rename sharepoint central administration database

Now, let’s move all sites from the Old database to New Database:

# Move central admin sites to from old Database to new SharePoint content database
Get-SPSite -ContentDatabase c633c573-966d-4362-a1f8-430fba561f11 | Move-SPSite -DestinationDatabase 8f35dc3b-56ab-45df-a1cf-459b60aa7454

#You must do an IISReset!
# Now, You can Remove OLD SharePoint admin content database using Old database ID - actually deletes the database on the SQL Server.
 Remove-SPContentDatabase -identity c633c573-966d-4362-a1f8-430fba561f11 

How to Avoid GUIDs in SharePoint Databases?
Prevention is better than cure! Always use PowerShell to avoid GUIDs in SharePoint Databases. Do not run the Products configuration wizard right after installation. Use PowerShell to create the SharePoint farm and service applications. How to Create a SharePoint 2013 Farm using PowerShell?

Salaudeen Rajack

Salaudeen Rajack - Information Technology Expert with Two decades of hands-on experience, specializing in SharePoint, PowerShell, Microsoft 365, and related products. Passionate about sharing the deep technical knowledge and experience to help others, through the real-world articles!

Leave a Reply

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