Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

SharePoint 2010 appears to continue SharePoint 2007's tradition of automatically creating horribly named SQL Databases. Like many companies we have multiple farms and developer workstations connecting to a central database server.

To make sure things don't become messy and difficult to manage, we prefer to use database names such as:

  • DEV_WS004_SharePoint_AdminContent
  • DEV_WS004_User Profile Service Application_ProfileDB

rather than:

  • SharePoint_AdminContent_9fc4ac7c-6895-4a74-bf10-df6ac4c2c1d6
  • User Profile Service Application_ProfileDB_a17efbf6942341f785c69829ce7f2d97

I am creating this question so we can create a central repository for renaming the various databases. I will try to find as many answers as possible myself, but would appreciate answers from the community as well.

At the moment the following databases have priority, but as we only have a limited set of services enabled I know there are many more.

  • SharePoint_AdminContent_[some guid]
  • Managed Metadata Service_[some guid]
  • Search_Service_Application_CrawlStoreDB_[some guid]
  • Search_Service_Application_DB_[some guid]
  • Search_Service_Application_PropertyStoreDB_[some guid]
  • User Profile Service Application_ProfileDB_[some guid]
  • User Profile Service Application_SocialDB_[some guid]
  • User Profile Service Application_SyncDB_[some guid]
  • WordAutomationServices_[some guid]
  • WSS_UsageApplication

Update: If you have multiple SharePoint 2010 farms connected to a single database server then you can see which databases belong to a farm on the following Central Administration screen: http://[Your CA Server]/_admin/DatabaseStatus.aspx. (CA / Upgrade and Migration / Review database status)

Update2: See this blog post on SharePoint 2010 Databases.

share|improve this question
add comment

5 Answers

up vote 3 down vote accepted

Hey there, so in my biased opinion, the best time to 'rename' a SharePoint database is before it's even created - in other words, you dictate the naming convention, not SharePoint's wizard. I've put together the AutoSPInstaller Powershell script to take care of this, and you can read about it on the 'Hey Scripting Guy' blog here.

Cheers Brian

share|improve this answer
    
I knew I was going to get this answer from at least one person, but for many people this will be too late as they will need to clean up someone else's environment without re-installing it. I haven't looked at your script yet, but I'll upvote it anyway as the idea is sound. –  Muhimbi Apr 24 '10 at 5:07
    
Is this the only / best publicly available SP2010 Auto Installer script or are there other, better, alternatives? –  Muhimbi Apr 24 '10 at 5:08
    
It has been a while, but I have started to use AutoSPInstaller. Although very light on documentation, it works well. My databases are now nicely organised. Marked as answer –  Muhimbi Mar 14 '11 at 17:05
add comment

To rename the SharePoint_AdminContent_[some guid] database the process is the same as under SharePoint 2007.

  1. Run as a user with the appropriate privileges to make these changes.

  2. stsadm.exe -o deletecontentdb -url http://[ca server]:[ca port] -databasename SharePoint_AdminContent_[some guid] -databaseserver [Your DB Server]

  3. Rename the database using a tool / script of your choice. We used SQL Management Studio. You may need to restart the SharePoint 2010 Timer service to make sure all connections to the DB are released or you will not be able to rename it.

  4. stsadm.exe -o addcontentdb -url http://[ca server]:[ca port] -databasename [Your new Database Name] -databaseserver [Your DB Server]

share|improve this answer
add comment

If you're stuck trying to rename databases such as that Search Administration DB that doesn't ask you what it wants to be called, the PowerShell instructions are here: http://technet.microsoft.com/en-nz/library/ff851878(en-us).aspx Note: some of the instructions here forget to tell you how to set the first Variable but easy to figure out.

If all else fails, another way to do this is the following:

  • Take a Backup of your farm using the SP Backup and Restore functionality
  • Delete the service application - e.g. Search Service Application
  • Check the Database status Screen to ensure the DB's are gone (http://[Your CA Server]/_admin/DatabaseStatus.aspx)
  • Restore the service application via Backup and Restore:
    • Choose the latest Backup
    • Select the Service to restore (not the whole farm - unless you want to)
    • Set Restore option to 'New Configuration'
    • Provide the new naming convention for each of the databases associated
    • Start Restore!
  • If you restore the Search Service Proxy, you man need to re-enable it in the Application Proxy Group under 'Service Application Associations'

Cheers, Dan

share|improve this answer
add comment

Microsoft has posted some guidance at http://technet.microsoft.com/en-us/library/ff851878.aspx It is helpful as it shows which methods can be used with which databases.

share|improve this answer
add comment

Nothing else required - except this.. by Toddklindt with screens.

share|improve this answer
    
Thanks, but that just appears to deal with the Admin Content DB. –  Muhimbi Oct 11 '10 at 8:57
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.