Renaming Admin Content Database and Other Content Databases in SharePoint using Powershell

Follow the below procedure to rename and attach the admin content database and other content databases.

  1. Log on to the SharePoint Server with Farm Account (Normally i do all stuffs in SharePoint using Farm Account as it has the highest privilege on the Farm.).
  2. Open SharePoint Management Shell with admin account.
  3. Run below command to create new Content DB. Let say we create a content db with the name “SharePoint_Admin_Content_DB”.

New-SPContentDatabase -Name “SharePoint_Admin_Content_DB” -WebApplication “http://w15-sp:2013”

test1

4. Run

Get-SPWebApplication -Identity “http://sharepoint:80” | Get-SPContentDatabase

You will get all the database name attached to this web application along with there ID, Name, WebApplication, Server, CurrentSiteCount.

test2

5. To get the site names run:

Get-SPSite -ContentDatabase “ID of Old Admin Content DB with GUID”

Capture

6. Run below command to move the site contents from OLD admin Content DB to new database “SharePoint_Admin_Content_DB”

Get-SPSite -ContentDatabase “ID of OLD Content DB” | Move-SPSite -DestinationDatabase “ID of new Content DB”

Capture1

7. Once the above command executes successfully run below command to check if the site count was updated for new database:

Get-SPWebApplication -Identity “http://w15-sp:2013” | Get-SPContentDatabase

Capture2

8. Then browse the Central Admin URL and check if it is accessible. Then Go to Manage Content Databases under Application Management. Change the Web Application to Central Admin and you will get below results.

Capture3

9. Remove the GUIDed Admin Content DB with below Command:

Remove-SPContentDatabase -Identity “GUID Database ID”

Capture4

10. Check the Central Admin URL and check if it is accessible. Then Go to Manage Content Databases under Application Management. Change the Web Application to Central Admin and you will see the new content db only with site count as 2. So your Central admin is working with new renamed Admin Content DB without GUID.

11. You can follow the same process for renaming the Content Databases as well.

Note: There are many approach to achieve this task but this the best option to do it through SharePoint.

 

 

This entry was posted in Articles. Bookmark the permalink.

Leave a comment