Wednesday, November 30, 2011

Attaching Content Database to Web Applications

To attach a content database to a Web application by using Windows PowerShell

  1. Verify that you meet the following minimum requirements: See Add-SPShellAdmin.
  2. On the Start menu, click All Programs.
  3. Click Microsoft SharePoint 2010 Products.
  4. Click SharePoint 2010 Management Shell.
  5. At the Windows PowerShell command prompt, type the following command:
    Mount-SPContentDatabase -Name <DatabaseName> -DatabaseServer <ServerName> -WebApplication <URL> [-Updateuserexperience]
    Where:
    • <DatabaseName> is the name of the database you want to upgrade.
    • <ServerName> is server on which the database is stored.
    • <URL> is the URL for the Web application that will host the sites.
    • Updateuserexperience is the choice to update to the new user experience or stay in the old user experience (part of Visual Upgrade). When you include this parameter, the site is set to preview the new user experience. Omit this parameter if you want the site to remain in the old user experience after upgrade. For more information, see Plan visual upgrade (SharePoint Server 2010).
For more information, see Mount-SPContentDatabase.
noteNote:
We recommend that you use Windows PowerShell when performing command-line administrative tasks. The Stsadm command-line tool has been deprecated, but is included to support compatibility with previous product versions.

To attach a content database to a Web application by using the Stsadm command-line tool

  1. On the drive on which SharePoint Products and Technologies is installed, change to the following directory: %COMMONPROGRAMFILES%\Microsoft shared\Web server extensions\14\Bin.
  2. Type the following command, and then press ENTER:

    stsadm -o addcontentdb -url<URL> -databasename<DatabaseName>

    [-databaseserver<ServerName>] [-databaseuser<UserName>]
    [-databasepassword<Password>] [-sitewarning<SiteWarningCount>]
    [-preserveolduserexperiencetrue/false]
    [-sitemax<SiteMaxCount>]
    [-assignnewdatabaseid][-clearchangelog]

No comments:

Post a Comment