Wednesday, July 8, 2009

How to change database names for SharePoint's Config and Admin Content databases

I revisited and documented in simple format one of the very tedious yet useful techniqes in SharePoint administration. These tips took me some time and many frustrating moments of trial-and-error's. Hopefully, those who are just entering the world of SharePoint administration find these tips useful and can save some time.

To change SharePoint_AdminContent database name
{   assuming the following ...
  • Central admin site = "http://mysharepoint:13311/"
  • Service account = "myDomain\John Doe" - (allow dbcreator role temporarily while performing this name change task)
  • Databse server name = "myDatabaseServer"
  • New admin content database name = "SharePoint_AdminContent"
}
  1. Backup current admin content database and restore it to a new database with the desirable name (i.e. SharePoint_AdminContent)
  2. In central admin site, remove the content database of the Central Admin site. After this, the Central Admin site becomes non- functional.
  3. On the web server that runs SharePoint Central Admin site, give local admin rights to the impersonator account("myDomain\John Doe") that connects to the database server for SharePoint.
  4. On the web server that runs SharePoint Central Admin site, open the command console and run the following command, [runas /u:"myDomain\John Doe" cmd.exe]. Enter password of "myDomain\John Doe" when prompted. A new console window will open up. 
  5. This will allow "myDomain\John Doe" to perform the following tasks as service account and relieve you of lots of permission-related conflict.
  6. On the new console window (running under "myDomain\John Doe"), go to the following path "C:\Progra~1\common files\Microsoft Shared\Web Server Extensions\12\bin\".
  7. Run "stsadm -o addcontentdb -url "http://mysharepoint:13311/" - databasename "SharePoint_AdminContent" -databaseserver "myDatabaseServer"

To change SharePoint_Config database name
{  assuming the following ...
  1. Central admin site = "http://mysharepoint:13311/"
  2. Service account = "myDomain\John Doe" - (allow dbcreator role temporarily for this example)
  3. Databse server name = "myDatabaseServer"
  4. New config database name = "SharePoint_Config"
}

::Method A
  1. Backup current config database. Create a new database with the desired name (i.e., SharePoint_Config) and restore from the database backup of the original config database.
  2. On the web server that runs SharePoint Central Admin site, give local admin rights to the impersonator account("myDomain\John Doe") that connects to the database server for SharePoint.
  3. On the web server that runs SharePoint Central Admin site, open the command console and run the following command, [ runas /u:"myDomain\John Doe" cmd.exe ]. Enter password of "myDomain\John Doe" when prompted. A new console window will open up. 
  4. This will allow "myDomain\John Doe" to perform the following tasks as service account and relieve you of lots of permission-related conflicts.
  5. On the new console window (running under "myDomain\John Doe"), go to the following path "C:\Progra~1\common files\Microsoft Shared\Web Server Extensions\12\bin\".
  6. Run stsadm -o deleteconfigdb
  7. Run stsadm -o setconfigdb -connect -databaseserver "myDatabaseServer" -databasename "SharePoint_Config" -farmuser "myDomain\John Doe" -farmpassword ""
  8. Run stsadm -o setadminport 13311.
  9. Run Configuration Wizard to re-install the Central Admin site.

::Method B
  1. Backup current config database. Create a new database with the desired name (i.e., SharePoint_Config) and restore from the database backup of the original config database.
  2. Run the SharePoint Products and Technologies Configuration Wizard on the server that hosts Central Admin Site.
  3. Disjoin from the current config database (current farm).
  4. Run the Configuration Wizard again and join an existing farm by specifying the database server name ("myDatabaseServer") and the new config database name ("SharePoint_Config").
  5. Run the Configuration Wizard again. Choose the option that the machine (server) will continue to host the web site.
  6. On the next window, you will see the URL of the Central Admin Site listed as (http://mysharepoint:13311/). Click Next.
  7. After the Wizard completes, you should have the Central Admin site come up automatically(http://mysharepoint:13311/).


No comments: