Export (0) Print
Expand All

Rename the State Service service application databases in SharePoint Server 2013

SharePoint 2013
 

Applies to: SharePoint Server 2013

Topic Last Modified: 2013-12-18

Summary: Learn how to rename the State Service service application databases in SharePoint Server 2013.

Renaming service application databases is typically done to remove the GUID from the database name after the databases have been created by the SharePoint Products Configuration Wizard, or to bring the databases into alignment with your organization's naming standards. You can rename the State Service application databases by using SQL Server tools and Windows PowerShell.

ImportantImportant:
The steps in this article apply to SharePoint Server 2013only.

In this article:

ImportantImportant:
On the database servers on which the operations are performed, you must be a member of the following:
  • Administrators group on the local server

  • db_owner fixed database role

In some environments, you must coordinate the rename procedures with the database administrator. Be sure to follow any applicable policies and guidelines for managing databases.

The instructions in this article assume that you have installed SQL Server Management Studio on the database server. If this is not the case, you can download and install Management Studio at Microsoft SQL Server 2008 R2 RTM - Management Studio Express.

NoteNote:
Because SharePoint 2013 runs as websites in Internet Information Services (IIS), administrators and users depend on the accessibility features that browsers provide. SharePoint 2013 supports the accessibility features of supported browsers. For more information, see the following resources:

To rename a service application database, you must use SQL Server. To move a service application database, you must use SQL Server and Windows Explorer. We recommend that you stop the services related to the service application before you rename or move the related database. In general, we expect that you will either rename or move a database. That is, you will typically not perform both actions.

To stop the service application
  1. Verify that the user account that is performing this procedure is a member of the Farm Administrators SharePoint group.

  2. For each service application that you plan to change the database for, you must stop the service or disable the service application by following the appropriate procedure for the service application that you are working with. For more information, see Start or stop a service (SharePoint 2013).

To rename the databases by using SQL Server Management Studio
  1. In SQL Server Management Studio, connect to the source SQL Server instance, and then expand the Databases node.

  2. Right-click the database that you want to rename, click Rename, and then type the new name. Repeat this step for each database that you want to rename.

The State Service database stores temporary data, state information, for InfoPath Forms Services, Exchange Server, the chart Web Part, and Visio Services. You can use Windows PowerShell to point the State Service service application to a renamed or moved database by performing one of the following procedures:

To add a new database to the State Service application and remove an old database by using Windows PowerShell
  1. Verify that you have the following memberships:

    • securityadmin fixed server role on the SQL Server instance.

    • db_owner fixed database role on all databases that are to be updated.

    • Administrators group on the server on which you are running the Windows PowerShell cmdlets.

    An administrator can use the Add-SPShellAdmin cmdlet to grant permissions to use SharePoint 2013 Products cmdlets.

    NoteNote:
    If you do not have permissions, contact your Setup administrator or SQL Server administrator to request permissions. For additional information about Windows PowerShell permissions, see Add-SPShellAdmin.
  2. Start the SharePoint 2013 Management Shell.

    • For Windows Server 2008 R2:

      • On the Start menu, click All Programs, click Microsoft SharePoint 2013 Products, and then click SharePoint 2013 Management Shell.

    • For Windows Server 2012:

      1. On the Start screen, click SharePoint 2013 Management Shell.

        If SharePoint 2013 Management Shell is not on the Start screen:

      2. Right-click Computer, click All apps, and then click SharePoint 2013 Management Shell.

    For more information about how to interact with Windows Server 2012, see Common Management Tasks and Navigation in Windows Server 2012.

  3. At the Windows PowerShell command prompt, type the following command:

    New-SPStateServiceDatabase -Name "<NewDatabaseName>"
    

    Then type the following command to remove the old database:

    Remove-SPStateServiceDatabase -Name "<OldDatabaseName>"
    

    Where:

    • <NewDatabaseName> is the name of the new database that you want to create.

    • <OldDatabaseName> is the name of the old database that you want to disassociate with the State service and detach from SQL Server.

For more information, see New-SPStateServiceDatabase and Remove-SPStateServiceDatabase.

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 point the State Service application to a renamed or moved database by using Windows PowerShell
  1. Verify that you have the following memberships:

    • securityadmin fixed server role on the SQL Server instance.

    • db_owner fixed database role on all databases that are to be updated.

    • Administrators group on the server on which you are running the Windows PowerShell cmdlets.

    An administrator can use the Add-SPShellAdmin cmdlet to grant permissions to use SharePoint 2013 Products cmdlets.

    NoteNote:
    If you do not have permissions, contact your Setup administrator or SQL Server administrator to request permissions. For additional information about Windows PowerShell permissions, see Add-SPShellAdmin.
  2. On the Start menu, click All Programs.

  3. Click Microsoft SharePoint 2013 Products.

  4. Click SharePoint 2013 Management Shell.

  5. At the Windows PowerShell command prompt, type the following command:

    Dismount-SPStateServiceDatabase -Identity <DatabaseID>
    

    Where:

    • <DatabaseID> is the State Service database to remove from the service application.The type must be a valid GUID in the form 12345678-90ab-cdef-1234-567890bcdefgh, a valid name of a state database, or an instance of a valid SPStateServiceDatabase object.

  6. Rename the database. For details, see To rename a database by using SQL Server Management Studio.

  7. At the Windows PowerShell command prompt, type the following command to mount the renamed database:

    Mount-SPStateServiceDatabase -Name "<DatabaseName>" -DatabaseServer "<ServerName>"
    

    Where:

    • <DatabaseName> is the name of the database to associate with the State service.

    • <ServerName> is the name of the SQL Server that hosts the State service database.

For more information, see Mount-SPStateServiceDatabase.

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.

Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft