Sitecore : The database principal owns a schema in the database, and cannot be dropped message
While upgradation to Sitecore 10.2, I was to restore the database on the Managed Cloud Service Azure SQL Server.
I have connected the Azure SQL server on my local SSMS and started to import the Database using the option Import Data-tier Application.
While importing the database using the above option you need a BACPAC file instead of a .bak file.
So I was to create a BACPAC file of the database from my local. Go to the database, right-click and select the Export Data-tier Application option under the Task menu.
After clicking on the next, while creating the BACPAC file you may get the below error:
Solution: Go to the Users in that Database. Your Database => Security => Users
Find the user, right click and delete it.
If you are unable to delete the user and encountered a new error as below:
It means the user you are going to delete owns a schema in the database and owners.
First, you need to search which schemas own by the user. Go to your database -> Security -> Users
Check the properties of the user by right click on the user and going to the owned schema.
Now change the owner of the schema. Go to your database -> Security -> Schemas
Right-click select properties and search the schema owner. If you don’t know then change the schema owner to DBO.
After that delete, the user and start again to export the database as BACPAC
Happy Sitecoreing 😊
Comments
Post a Comment