Share via

Remove GUID from StateService application database in SQL server

Srikanth 41 Reputation points
2023-03-06T15:58:57.3933333+00:00

We have created a state service application on our SharePoint 2019 farm using the central admin site, it created the state service application database in SQL server as

StateService_GUID

Can you please let me know if there is away to rename this database using powershell ?

Microsoft 365 and Office | SharePoint Server | For business
Windows for business | Windows Server | User experience | PowerShell
0 comments No comments

1 answer

Sort by: Most helpful
  1. AllenXu-MSFT 24,991 Reputation points Moderator
    2023-03-07T06:45:25.9866667+00:00

    Hi @Srikanth,

    The state service application databases use the following steps:

    1. Stop or disable the service application. Stop-SPServiceInstance -Identity <ServiceGUID>
    2. Detach the database.
    3. Move or rename the database.
    4. Attach the database.
    5. Point the service application to the moved or renamed database using PowerShell. https://learn.microsoft.com/en-us/sharepoint/administration/move-or-rename-service-application-databases#PS
    6. Restart the service application.

    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    Was this answer helpful?


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.