Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

sqlpackage.exe: any way to ignore users on export?

I'm trying to create a bacpac file to export my databases to azure.
Is there anyway of making it ignore the users, while creating an export package (sqlpackage /a:Export) ?

like image 252
Luis Abreu Avatar asked May 25 '17 13:05

Luis Abreu


People also ask

What is SqlPackage EXE?

SqlPackage.exe is a command-line utility that automates the following database development tasks by exposing some of the public Data-Tier Application Framework (DacFx) APIs: Version: Returns the build number of the SqlPackage application.

How do I extract Dacpac?

Right-click the DAC package (. dacpac) file and select Unpack. Double-click the DAC package file.

What is Bacpac and Dacpac?

A DAC is a logical database management entity that defines all of the SQL Server objects which associates with a user's database. A BACPAC includes the database schema as well as the data stored in the database.


1 Answers

No, unfortunately, there is no option to ignore users on export.

You could, in the alternative, produce a dacpac file with data (sqlpackage /a:extract /p:ExtractAllTableData=true) and ignore users when publishing... but that would only work for a pristine database, because dacpacs skip most Azure import niceties (like publishing stored procedures first to take advantage of deferred name resolution).

I'm guessing that you would like to ignore users because your database contains some users mapped to Windows logins and you'd like to avoid producing a new version of the database that contains only Azure SQL DB-compatible objects. If so, you might be interested in trying the private preview of the Azure SQL Database migration service: https://blogs.technet.microsoft.com/dataplatforminsider/2017/04/25/get-to-cloud-faster-with-a-new-database-migration-service-private-preview/

like image 147
Steven Green Avatar answered Oct 07 '22 02:10

Steven Green