Search This Blog

Wednesday, December 11, 2019

How to Backup Azure SQL Database to Local - Part 2

Continue from Part 1, we are going to explore next tool to backup Azure SQL Database to local.

Tool 2:- Use SQLPackage Utility. This tool will create BACPAC file from a command line. You can run unattended/automatically using batch file & scheduler.

Download SQLPackage from here
Download Visual Studio Community. Install Data Storage & Processing
Install Analysis Services & Reporting Services, Integration Services component in Visual Studio Market Place. Click here


Query the location of SQLPackage by typing command "dir sqlpackage.exe /s /p"

[ Backup ]

Execute command 

sqlpackage.exe /Action:Export /ssn:tcp:<location> /sdn:<dbname> /su:<username> /tf:c:\backup\<dbname>.bacpac /sp:<password> /p:Storage=File

sqlpackage.exe /Action:Export / /sdn:testdb1 /su:ericlaiys2019 /tf:c:\backup\testsqlpackage.bacpac /sp:[email protected] /p:Storage=File

Click here for Part 3.