Exporting Optimizely databases causing errors

When transferring your Optimizely site to the cloud, whether it is DXP or Azure, you probably want to run an «Export Data-tier Application...» like this to get that .bacpac file.

Export Data-tier Application...

Most of the time this will complete without errors, but every now and then we get something like this.

One or more unsupported elements were found in the schema used as part of a data package. Error SQL 71627: The element User: {username} has a property AuthenticationType set to a value that is not supported in Microsoft SQL Database v12.

One or more unsupported elements were found in the schema used as part of a data package. Error SQL 71627: The element User: {username} has a property AuthenticationType set to a value that is not supported in Microsoft SQL Database v12.

Sure, no problem! Let's just delete that user!

Drop failed for User. The database principal owns a schema in the database, and cannot be dropped.

Drop failed for User. The database principal owns a schema in the database, and cannot be dropped.

First we need to locate what schema this user owns. The query below will provide a list of users and the schemas they own. Simply locate the user we want to delete.

SELECT S.*, [owns the schema]=dp.name, dp.type_desc
FROM SYS.schemas S
INNER JOIN SYS.database_principals dp
       ON S.principal_id = dp.principal_id

In my case the user owned the schema db_owner, so we can just transfer ownership like this.

alter authorization
on schema::db_owner
to dbo

That's it, now the user can be deleted and the database exported.

Found this post helpful? Help keep this blog ad-free by buying me a coffee! ☕