次の方法で共有


Having a custom Admin Content Database in SharePoint 2007

One of the common business requirements is to have a custom name for the Admin Content (Central Administration) Database. There are two ways to achieve that. One is to choose the custom name while installation and the second way is to rename the databases after the initial configuration.

Choose Custom Admin Content DB Name During Initial Configuration

It is possible to have a custom Admin Content DB name while setting up SharePoint for the first time. Follow these steps to achieve a custom name for the Admin Content Database and SharePoint Configuration Database.

1. Install SharePoint 2007 and all associated updates (such as SP1, and the latest cumulative updates). Do not run SharePoint Configuration Wizard.

2. Open up Command Prompt in Admin Mode (Run as Administrator).

3. Go to BIN folder or add the path c:\Program Files\Common Files\microsoft Shared\Web Server Extensions\12\BIN to environment variables to access PSCONFIG.EXE from anywhere.

a. To Add a Path either use the Environment Variables menu or via REGEDIT in the following path HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment

image

4. Type the following command to create the Configuration and the AdminContent Database

Psconfig –cmd configdb –create –server <YourDatabaseServerName> –database <YouyCustomSharePoint_ConfigDBName> –user <domain\FarmAdminUserAccount> –password <FarmAdminPassword> –adminicontentdatabase <YourCustomAdminContentDBName>

In the screenshot below, ContosoSQL is our Database Server and contoso\MOSSAdmin is our SharePoint Farm Administrator Account.

image

Once the command finishes, you will get the Custom database names:

clip_image002

5. After this you have to provision the Central Administration Site, preferably with a port number that you can easily remember. Use the following command to achieve this:

psconfig.exe -cmd adminvs -provision -port 12345 -windowsauthprovider onlyusentlm

Onlyusentml is used to configure SharePoint in NTML (default). If you need SharePoint to be configured in Kerberos there are additional steps required. Refer to Configure Kerberos authentication (Office SharePoint Server) (https://technet.microsoft.com/en-us/library/cc263449.aspx) article for more information.

6. The next step is to secure the registry entries. Run the following command:

psconfig.exe -cmd secureresources

clip_image002[5]

 

The following steps are required if this is fresh install.

7. To install the Help Collection run the following command:

psconfig`` -cmd helpcollections –installall

8. Register services in the server farm:

psconfig -cmd services –install

The rest of the steps can be performed via the GUI or command line.

9. Start the Windows SharePoint help search.

clip_image002[7]

10. Start the Office SharePoint Server Search.

clip_image002[9]

11. Provision the services of the farm psconfig -cmd services –provision

12. Register all features - psconfig`` -cmd installfeatures

13. Configure shared service administration.

Renaming the Admin Content DB - post install

Often when you will visit the client you will see that SharePoint has already been deployed and that the default Admin Content DB name is Admin_Content_<GUID> .

To change the names to something more meaningful, follow the steps below.

Changing the Admin Content Database Name

Follow the steps below to rename the admin content database

  1. Log in to SQL Server and take a full backup of the Admin Content Database.
  2. Run the preparetomove switch to get the Web application ready:

stsadm.exe -o preparetomove
           {-ContentDB <DatabaseServer:DatabaseName> |
            -Site <URL>}
           [-OldContentDB <uniqueidentifier>]
           [-undo]

  1. Through Central Admin make the database Offline and remove it.
    • Log into SharePoint Central Administration and navigate to Application Management > Content Databases.
    • Change to Admin Content Database (Choose Central Administration).

clip_image002[11]

    • Click the Database Name (Admin_Content_<GUID>) and change the database status to Offline and Click OK.

clip_image004

    • Click the Database Name (Admin_Content_<GUID>) and choose Remove Content Database and Click OK.

NOTE: If the database size is huge, for example a site content database, use the stsadm tool to do this. (Ref: https://technet.microsoft.com/en-us/library/cc262449.aspx). You may get an unknown error after the database is removed, which is okay. This error doesn’t appear if you are removing the DB from command prompt.

4. Go to SQL Server (using an account with Admin permissions) and restore the backup of the Admin Content Database with a new name. You can also rename the LOG and MDF file now.

  • Change the Database Name in the To database field.

clip_image002[13]

  • Take the old database Offline from SQL Server.
  • Go to the command prompt and enter the following command to attach the content database to the Web application:

stsadm -o addcontentdb -url <CentralAdminURL> -databasename <YourCustomDatabaseName> -databaseserver <YourDatabaseServerName>

clip_image004[5]

5. From the Manage Content Database you can verify the new database associated with your central Admin Site.

clip_image006

Comments

  • Anonymous
    May 11, 2009
    PingBack from http://www.codedstyle.com/having-a-custom-admin-content-database-in-sharepoint-2007/

  • Anonymous
    July 30, 2009
    I must be missing something, I am trying to rename the Content db post install and get an Access denied when running the addcontentdb command.

  • Anonymous
    July 31, 2009
    Are you using win 08? then you have to start the command prompt in admin mode (Run As Administrator)

  • Anonymous
    January 20, 2011
    Great post!Worked swiftly for me!