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
) ?
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.
Right-click the DAC package (. dacpac) file and select Unpack. Double-click the DAC package file.
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.
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/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With