SharePoint 2019 - upgrade failure due to SQL onwer

ChrisEaker 0 Reputation points
2025-02-04T14:57:21.4333333+00:00

When running SharePoint 2019 update I receive the following error:

Task upgrade has failed with a PostSetupConfigurationTaskException An exception of type Microsoft.SharePoint.PostSetupConfiguration.PostSetupConfigurationTaskException was thrown. Additional exception information: The upgrade command is invalid or a failure has been encountered.

Error running SQL DDL Script: IF EXISTS (SELECT TOP 1 1 FROM sys.database_principals WHERE name = N'db_owner' A.... System.Data.SqlClient.SqlException (0x80131904): Cannot alter the role 'db_owner', because it does not exist or you do not have permission.ClientConnectionId:d20ae970-3be5-4e9a-bb84-4bc2aa1b31c8Error Number:15151,State:1,Class:16 (EventID:anah0)

Upgrade [SPSubscriptionSettingsDatabase Name=SP_SA_SubscriptionsSettingsS...] failed. (EventID:an59t)

Exception: Cannot alter the role 'db_owner', because it does not exist or you do not have permission. (EventID:an59t)

*(EventID:an59t)*
```*Upgrade Timer job is exiting due to exception: System.Data.SqlClient.SqlException (0x80131904): Cannot alter the role 'db_owner', because it does not exist or you do not have permission.*

I **went to the SQL server to discover my SharePoint databases have different owners.  What is the recommended best practice?**

SharePoint Server
SharePoint Server
A family of Microsoft on-premises document management and storage systems.
2,418 questions
SharePoint Server Management
SharePoint Server Management
SharePoint Server: A family of Microsoft on-premises document management and storage systems.Management: The act or process of organizing, handling, directing or controlling something.
2,992 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Yanli Jiang - MSFT 28,706 Reputation points Microsoft Vendor
    2025-02-05T02:47:28.8833333+00:00

    Hi @ChrisEaker ,

    Good days, thanks for querying in this forum. We’re happy to help you.

    To resolve the upgrade failure in SharePoint 2019 due to SQL owner issues, it's essential to ensure that the account you are using has the appropriate permissions. Specifically, the account should be a member of the db_owner fixed database role for all SharePoint databases. If the databases have different owners, you may need to standardize the ownership to avoid permission issues during the upgrade process.

    Here are some recommended best practices:

    1. Verify Database Owners: Check the owners of your SharePoint databases and ensure they are consistent. You can use SQL Server Management Studio (SSMS) to view and modify the database owners.
    2. Set the Correct Owner: If necessary, change the database owner to a service account that has the required permissions. You can do this using the following SQL command:
       ALTER AUTHORIZATION ON DATABASE::[YourDatabaseName] TO [YourServiceAccount]
    
    1. Ensure Proper Permissions: Make sure that the account used for the upgrade has the db_owner role on all relevant databases. This is crucial for the upgrade process to succeed.
    2. Review Upgrade Logs: After making changes, review the upgrade logs for any additional errors or warnings that may indicate further issues.

    Following these steps should help you resolve the upgrade failure related to SQL owner permissions.

    Reference: Upgrade content databases to SharePoint Server 2019

    Hope this helps.

    Please do let us know if you have any further queries.

    Kindly consider accepting the answer if the information provided is helpful. This can assist other community members in resolving similar issues.

    0 comments No comments

Your answer

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