title | description | keywords | services | documentationcenter | author | manager | editor | ms.assetid | ms.service | ms.custom | ms.devlang | ms.topic | ms.tgt_pltfrm | ms.workload | ms.date | ms.author |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
SqlPackage: Export a SQL Server database to a BACPAC file (Azure) | Microsoft Docs |
his article shows how to export a SQL Server database to a BACPAC file using the SqlPackage command-line utility. |
Microsoft Azure SQL Database, database migration, export database, export BACPAC file, sqlpackage |
sql-database |
CarlRabeler |
jhubbard |
7b9541c5-5590-4c70-ad36-73007389f6dc |
sql-database |
migrate and move |
NA |
article |
NA |
sqldb-migrate |
02/07/2017 |
carlrab |
This article shows how to export an Azure SQL database or a SQL Server database to a BACPAC file using the SqlPackage command-line utility. This utility ships with the latest versions of SQL Server Management Studio and SQL Server Data Tools for Visual Studio, or you can download the latest version of SqlPackage directly from the Microsoft download center.
For an overview of exporting to a BACPAC file, see Export to a BACPAC.
Note
You can also export your Azure SQL database file to a BACPAC file using the Azure portal, SQL Server Management Studio, or PowerShell.
- Open a command prompt and change a directory containing the sqlpackage.exe command-line utility - this utility ships with both Visual Studio and SQL Server. Use search on your computer to find the path in your environment.
- Execute the following sqlpackage.exe command with the following arguments for your environment:
Argument | Description |
---|---|
< server_name > | source server name |
< database_name > | source database name |
< target_file > | file name and location for BACPAC file |
- To learn about importing a BACPAC using SQLPackage, see Import a BACPAC to Azure SQL Database using SqlPackage
- To learn about importing a BACPAC using the Azure portal, see Import a BACPAC to Azure SQL Database using the Azure portal
- To learn about importing a BACPAC using PowerShell, see Import a BACPAC to Azure SQL Database using PowerShell
- For a discussion of the entire SQL Server database migration process, including performance recommendations, see Migrate a SQL Server database to Azure SQL Database.
- To learn about long-term backup retention of an Azure SQL database backup as an alternative to exported a database for archive purposes, see Long term backup retention
- To learn about importing a BACPAC to a SQL Server database, see Import a BACPCAC to a SQL Server database