Skip to content

Commit f1f4896

Browse files
Merge pull request #36480 from MicrosoftDocs/main
Auto Publish – main to live - 2026-01-27 18:30 UTC
2 parents a3b5438 + 93ad4ec commit f1f4896

364 files changed

Lines changed: 2015 additions & 1747 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

azure-sql/database/database-export.md

Lines changed: 41 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
---
22
title: Export a Database to a BACPAC File
33
titleSuffix: Azure SQL Database & Azure SQL Managed Instance
4-
description: Export a database to a BACPAC file using the Azure portal, PowerShell, Azure Data Studio, or SQL Server Management Studio.
4+
description: Export a database to a BACPAC file using the Azure portal, PowerShell, Visual Studio Code, or SQL Server Management Studio.
55
author: WilliamDAssafMSFT
66
ms.author: wiassaf
7-
ms.reviewer: mathoma, hudequei
8-
ms.date: 08/07/2025
7+
ms.reviewer: mathoma, hudequei, randolphwest
8+
ms.date: 01/26/2026
99
ms.service: azure-sql
1010
ms.subservice: data-movement
1111
ms.topic: how-to
@@ -22,37 +22,44 @@ When you need to export a database for archiving or for moving to another platfo
2222

2323
## Considerations
2424

25-
- For an export to be transactionally consistent, you must ensure either that no write activity is occurring during the export, or that you're exporting from a [transactionally consistent copy](database-copy.md) of your database.
26-
- If you're exporting to blob storage, the maximum size of a BACPAC file is 200 GB. To archive a larger BACPAC file, export to local storage with SqlPackage.
27-
- [Import and Export using Private Link](database-import-export-private-link.md) is in preview.
28-
- The Azure Storage file name can't end with `.` and can't contain special characters like a space character or `<`, `>`, `*`, `%`, `&`, `:`, `\`, `/`, `?`. The file name should be fewer than 128 characters long.
29-
- If the export operation exceeds 20 hours, it might be canceled. To increase performance during export, you can:
25+
For an export to be transactionally consistent, you must ensure either that no write activity is occurring during the export, or that you're exporting from a [transactionally consistent copy](database-copy.md) of your database.
3026

31-
- Temporarily increase your compute size.
32-
- Cease all read and write activity during the export.
33-
- Use a [clustered index](/sql/relational-databases/indexes/clustered-and-nonclustered-indexes-described) with non-null values on all large tables. Without clustered indexes, an export might fail if it takes longer than 6-12 hours. This is because the export service needs to complete a table scan to try to export entire table. A good way to determine if your tables are optimized for export is to run `DBCC SHOW_STATISTICS` and make sure that the *RANGE_HI_KEY* isn't null and its value has good distribution. For details, see [DBCC SHOW_STATISTICS](/sql/t-sql/database-console-commands/dbcc-show-statistics-transact-sql).
34-
- For larger databases, BACPAC export/import might take a long time, and might fail for various reasons.
35-
36-
> [!NOTE]
37-
> BACPACs are not intended to be used for backup and restore operations. Azure automatically creates backups for every user database. For details, see [business continuity overview](business-continuity-high-availability-disaster-recover-hadr-overview.md) and [Automated backups in Azure SQL Database](automated-backups-overview.md?view=azuresql-db&preserve-view=true) or [Automated backups in Azure SQL Managed Instance](../managed-instance/automated-backups-overview.md?view=azuresql-mi&preserve-view=true).
27+
If you're exporting to blob storage, the maximum size of a BACPAC file is 200 GB. To archive a larger BACPAC file, export to local storage with SqlPackage.
28+
29+
[Import or export an Azure SQL Database by using private link](database-import-export-private-link.md) is in preview.
30+
31+
The Azure Storage file name can't end with `.` and can't contain special characters like a space character or `<`, `>`, `*`, `%`, `&`, `:`, `\`, `/`, `?`. The file name should be fewer than 128 characters long.
32+
33+
If the export operation exceeds 20 hours, it might be canceled. To increase performance during export, you can:
34+
35+
- Temporarily increase your compute size.
36+
37+
- Cease all read and write activity during the export.
38+
39+
- Use a [clustered index](/sql/relational-databases/indexes/clustered-and-nonclustered-indexes-described) with non-null values on all large tables. Without clustered indexes, an export might fail if it takes longer than 6-12 hours. This is because the export service needs to complete a table scan to try to export entire table. A good way to determine if your tables are optimized for export is to run `DBCC SHOW_STATISTICS` and make sure that the `RANGE_HI_KEY` isn't null and its value has good distribution. For details, see [DBCC SHOW_STATISTICS (Transact-SQL)](/sql/t-sql/database-console-commands/dbcc-show-statistics-transact-sql).
40+
41+
- For larger databases, BACPAC export/import might take a long time, and might fail for various reasons.
42+
43+
> [!NOTE]
44+
> BACPACs aren't intended to be used for backup and restore operations. Azure automatically creates backups for every user database. For details, see [business continuity overview](business-continuity-high-availability-disaster-recover-hadr-overview.md) and [Automated backups in Azure SQL Database](automated-backups-overview.md?view=azuresql-db&preserve-view=true) or [Automated backups in Azure SQL Managed Instance](../managed-instance/automated-backups-overview.md?view=azuresql-mi&preserve-view=true).
3845
3946
<a id="the-azure-portal"></a>
4047

4148
## Export from the Azure portal
4249

43-
- You can use the Azure portal to export a BACPAC of a database in an [Azure SQL Database logical server](logical-servers.md).
50+
- You can use the Azure portal to export a BACPAC of a database in an [Azure SQL Database logical server](logical-servers.md).
4451
- Using the Azure portal isn't currently supported to export a BACPAC of a database from [Azure SQL Managed Instance](../managed-instance/sql-managed-instance-paas-overview.md).
4552

46-
> [!NOTE]
53+
> [!NOTE]
4754
> Machines processing import/export requests submitted through the Azure portal or PowerShell need to store the BACPAC file and temporary files generated by the Data-Tier Application Framework (DacFX). The disk space required varies significantly among databases with the same size and can require disk space up to three times the size of the database. Machines running the import/export request only have 450GB local disk space. As a result, some requests might fail with the error `There is not enough space on the disk`. In this case, the workaround is to run SqlPackage on a machine with enough local disk space. Use the [SQLPackage utility](#sqlpackage-utility) to import/export databases larger than 150GB to avoid this issue.
4855
4956
1. To export a database using the [Azure portal](https://portal.azure.com), open the page for your database and select **Export** on the toolbar.
5057

51-
:::image type="content" source="media/database-export/sql-database-export-menu-button.png" alt-text="Screenshot that highlights the Export button." lightbox="media/database-export/sql-database-export-menu-button.png":::
58+
:::image type="content" source="media/database-export/sql-database-export-menu-button.png" alt-text="Screenshot that highlights the Export button." lightbox="media/database-export/sql-database-export-menu-button.png":::
5259

5360
1. Specify the BACPAC filename, select an existing Azure storage account and container for the export, and then provide the appropriate credentials for access to the source database. A SQL **Server admin login** is needed here even if you're the Azure admin, as being an Azure admin doesn't equate to having admin permissions in Azure SQL Database or Azure SQL Managed Instance.
5461

55-
:::image type="content" source="media/database-export/sql-database-export-database.png" alt-text="Screenshot shows the Export Database page with username and password specified.":::
62+
:::image type="content" source="media/database-export/sql-database-export-database.png" alt-text="Screenshot shows the Export Database page with username and password specified.":::
5663

5764
1. Select **OK**.
5865

@@ -67,12 +74,12 @@ To export a database in SQL Database using the [SQLPackage](/sql/tools/sqlpackag
6774
This example shows how to export a database using SqlPackage with Active Directory Universal Authentication:
6875

6976
```cmd
70-
SqlPackage /a:Export /tf:testExport.BACPAC /scs:"Data Source=apptestserver.database.windows.net;Initial Catalog=MyDB;" /ua:True /tid:"apptest.onmicrosoft.com"
77+
SqlPackage /a:Export /tf:testExport.bacpac /scs:"Data Source=apptestserver.database.windows.net;Initial Catalog=MyDB;" /ua:True /tid:"apptest.onmicrosoft.com"
7178
```
7279

73-
## Azure Data Studio
80+
## Visual Studio Code
7481

75-
[Azure Data Studio](/azure-data-studio) is a free, open-source tool and is available for Windows, Mac, and Linux. The "SQL Server dacpac" extension provides a wizard interface to SqlPackage operations including export and import. For more information on installing and using the extension, see [SQL Server dacpac extension](/azure-data-studio/extensions/sql-server-dacpac-extension).
82+
The MSSQL extension for Visual Studio Code is a free, open-source extension available for Windows, macOS, and Linux. The extension includes the [Data-tier Application (Preview)](/sql/tools/visual-studio-code-extensions/mssql/mssql-data-tier-application) experience for SqlPackage operations, including export and import. For more information on installing and using the extension, see the [MSSQL extension for Visual Studio Code](/sql/tools/visual-studio-code-extensions/mssql/mssql-extension-visual-studio-code).
7683

7784
## SQL Server Management Studio (SSMS)
7885

@@ -113,9 +120,10 @@ Use the [Database Operations - Cancel](/rest/api/sql/database-operations/cancel)
113120
Stop-AzSqlDatabaseActivity -ResourceGroupName $ResourceGroupName -ServerName $ServerName -DatabaseName $DatabaseName -OperationId $Operation.OperationId
114121
```
115122

116-
> [!NOTE]
123+
> [!NOTE]
117124
> To cancel export operation, you need to have one of the following roles:
118-
> - The [SQL DB Contributor](/azure/role-based-access-control/built-in-roles#sql-db-contributor) role or
125+
>
126+
> - The [SQL DB Contributor](/azure/role-based-access-control/built-in-roles#sql-db-contributor) role or
119127
> - A [custom Azure RBAC role](/azure/role-based-access-control/custom-roles) with `Microsoft.Sql/servers/databases/operations` permission
120128
121129
## Limitations
@@ -124,14 +132,15 @@ Stop-AzSqlDatabaseActivity -ResourceGroupName $ResourceGroupName -ServerName $Se
124132
- Storage behind a firewall is currently not supported.
125133
- Immutable storage is currently not supported.
126134
- [Azure SQL Managed Instance](../managed-instance/sql-managed-instance-paas-overview.md) doesn't currently support exporting a database to a BACPAC file using the Azure portal or Azure PowerShell. To export a managed instance into a BACPAC file, use SQL Server Management Studio (SSMS) or [SQLPackage](/sql/tools/sqlpackage).
127-
- Currently, the Import/Export service does not support Microsoft Entra ID authentication when MFA is required.
128-
- Import\Export services only support SQL authentication and Microsoft Entra ID. Import\Export is not compatible with Microsoft Identity application registration.
135+
- Currently, the Import/Export service doesn't support Microsoft Entra ID authentication when MFA is required.
136+
- Import\Export services only support SQL authentication and Microsoft Entra ID. Import\Export isn't compatible with Microsoft Identity application registration.
129137

130138
## Related content
131139

132-
- To learn about long-term backup retention of a single database and pooled databases as an alternative to exporting a database for archive purposes, see [Long-term backup retention](long-term-retention-overview.md). You can use SQL Agent jobs to schedule [copy-only database backups](/sql/relational-databases/backup-restore/copy-only-backups-sql-server) as an alternative to long-term backup retention.
133-
- To learn about importing a BACPAC to a SQL Server database, see [Import a BACPAC to a SQL Server database](/sql/relational-databases/data-tier-applications/import-a-BACPAC-file-to-create-a-new-user-database).
134-
- To learn about exporting a BACPAC from a SQL Server database, see [Export a Data-tier Application](/sql/relational-databases/data-tier-applications/export-a-data-tier-application)
135-
- To learn about using the Data Migration Service to migrate a database, see [Migrate from SQL Server to Azure SQL Database offline using DMS](/azure/dms/tutorial-sql-server-to-azure-sql).
136-
- If you're exporting from SQL Server as a prelude to migration to Azure SQL Database, see [Migrate a SQL Server database to Azure SQL Database](migrate-to-database-from-sql-server.md).
137-
- To learn how to manage and share storage keys and shared access signatures securely, see [Security recommendations for Blob storage](/azure/storage/blobs/security-recommendations).
140+
- [Long-term retention backups - Azure SQL Database and Azure SQL Managed Instance](long-term-retention-overview.md)
141+
- [copy-only database backups](/sql/relational-databases/backup-restore/copy-only-backups-sql-server)
142+
- [Import a BACPAC to a SQL Server database](/sql/relational-databases/data-tier-applications/import-a-BACPAC-file-to-create-a-new-user-database)
143+
- [Export a Data-tier Application](/sql/relational-databases/data-tier-applications/export-a-data-tier-application)
144+
- [Migrate from SQL Server to Azure SQL Database offline using DMS](/azure/dms/tutorial-sql-server-to-azure-sql)
145+
- [Migrate a SQL Server database to Azure SQL Database](migrate-to-database-from-sql-server.md)
146+
- [Security recommendations for Blob storage](/azure/storage/blobs/security-recommendations)

azure-sql/database/database-import-export-hang.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,19 @@ titleSuffix: Azure SQL Database & Azure SQL Managed Instance
44
description: Azure SQL Database and Azure SQL Managed Instance Import/Export service takes a long time to import or export a database
55
author: WilliamDAssafMSFT
66
ms.author: wiassaf
7-
ms.reviewer: mathoma, hudequei, sureshka
8-
ms.date: 06/13/2025
7+
ms.reviewer: mathoma, hudequei, sureshka, randolphwest
8+
ms.date: 01/26/2026
99
ms.service: azure-sql
1010
ms.subservice: data-movement
1111
ms.topic: troubleshooting
1212
ms.custom:
1313
- sqldbrb=1
14-
monikerRange: "=azuresql || =azuresql-db || =azuresql-mi "
14+
monikerRange: "=azuresql || =azuresql-db || =azuresql-mi"
1515
---
1616

1717
# Azure SQL Database and SQL Managed Instance Import/Export service takes a long time to import or export a database
1818

19-
[!INCLUDE[appliesto-sqldb-sqlmi](../includes/appliesto-sqldb-sqlmi.md)]
19+
[!INCLUDE [appliesto-sqldb-sqlmi](../includes/appliesto-sqldb-sqlmi.md)]
2020

2121
When you use the Import/Export service, the process might take longer than expected. This article describes the potential causes for this delay and alternative workaround methods.
2222

@@ -32,26 +32,26 @@ The Azure SQL Database Import/Export service provides a limited number of comput
3232

3333
Additionally, as the Import/Export service performs a logical backup of the database the time to complete is more dependent on the number of objects in the database than a traditional physical database backup.
3434

35-
> [!NOTE]
35+
> [!NOTE]
3636
> After resources are assigned and a request starts to process, the service automatically cancels the request after two days.
3737
3838
## Recommended solutions
3939

4040
If your database exports are used only for recovery from accidental data deletion, all the Azure SQL Database editions provide self-service restoration capability from system-generated backups. But if you need these exports for other reasons, and if you require consistently faster or more predictable import/export performance, consider the following options:
4141

42-
- [Export to a BACPAC file by using the SQLPackage utility](./database-export.md#sqlpackage-utility).
43-
- [Export to a BACPAC file by using Azure Data Studio](./database-export.md#azure-data-studio).
44-
- [Export to a BACPAC file by using SQL Server Management Studio (SSMS)](./database-export.md#sql-server-management-studio-ssms).
42+
- [Export to a BACPAC file by using the SQLPackage utility](database-export.md#sqlpackage-utility).
43+
- [Export to a BACPAC file by using Visual Studio Code](/sql/tools/visual-studio-code-extensions/mssql/mssql-data-tier-application).
44+
- [Export to a BACPAC file by using SQL Server Management Studio (SSMS)](database-export.md#sql-server-management-studio-ssms).
4545
- Run the BACPAC import or export directly in your code by using the Microsoft SQL Server Data-Tier Application Framework (DacFx) API. For additional information, see:
46-
* [Export a data-tier application](/sql/relational-databases/data-tier-applications/export-a-data-tier-application)
47-
* [Microsoft.SqlServer.Dac Namespace](/dotnet/api/microsoft.sqlserver.dac)
46+
- [Export a data-tier application](/sql/relational-databases/data-tier-applications/export-a-data-tier-application)
47+
- [Microsoft.SqlServer.Dac Namespace](/dotnet/api/microsoft.sqlserver.dac)
4848

4949
## Things to consider when you export or import a database
5050

51-
- All the methods discussed in this article consume Database Transaction Units (DTUs) or CPU quota, which causes throttling by the Azure SQL Database service. You can [view the DTU stats for the database on the Azure portal](./monitor-tune-overview.md#azure-sql-database-and-azure-sql-managed-instance-resource-monitoring). If the database has reached its resource limits, [upgrade the service tier](scale-resources.md) to add more resources.
51+
- All the methods discussed in this article consume Database Transaction Units (DTUs) or CPU quota, which causes throttling by the Azure SQL Database service. You can [view the DTU stats for the database on the Azure portal](monitor-tune-overview.md#azure-sql-database-and-azure-sql-managed-instance-resource-monitoring). If the database has reached its resource limits, [upgrade the service tier](scale-resources.md) to add more resources.
5252
- Ideally, you should run client applications (like the sqlpackage utility or your custom DAC application) from a VM in the same region as your database. Otherwise, you might experience performance issues related to network latency.
5353
- Exporting large tables without clustered indexes can be very slow or even cause failure. This behavior occurs because the table can't be split up and exported in parallel. Instead, it must be exported in a single transaction, and that causes slow performance and potential failure during export, especially for large tables.
5454

5555
## Related documents
5656

57-
[Considerations when exporting a database](./database-export.md#considerations)
57+
[Considerations when exporting a database](database-export.md#considerations)

0 commit comments

Comments
 (0)