Edit

Export databases in the admin center

From the Business Central administration center, you can export the database for Business Central online environments as BACPAC files to an Azure storage container.

Considerations before you begin

  • You can only request a database export if the customer has a paid Business Central subscription.
  • You must have explicit permission to export databases. Learn more in the Users who can export databases section.
  • You can't export your database to an Azure premium storage account. The steps in this article only support Azure standard storage accounts.
  • You can export the database of an environment that's encrypted with a customer-managed encryption key. The BACPAC files in the storage account are encrypted with the encryption key applied to the storage account, not the environment's encryption key.

Note

For each environment, you can export the database a maximum of 10 times per month. You can see the number of exports still remaining for the current month in the Create Database Export pane when creating the export file.

Set up Azure storage

Before you can export the file, set up the Azure storage account container that the BACPAC file.

Create the storage account

The first step is to create a Standard general-purpose v2 Azure storage account, if you don't already have one. To set up the export, you must first have a subscription to Microsoft Azure and access to the Azure portal.

Important

Exporting an environment database to a storage account that isn't a Standard general-purpose v2 Azure storage account, such as V1 or Premium storage accounts, isn't supported.

Learn more about setting up an Azure storage account in Create a storage account.

Generating a shared access signature (SAS)

The next step is to generate a shared access signature (SAS) that provides secure delegated access to your storage account. Business Central uses the signature to write the BACPAC file to your storage account.

To generate a shared access signature (SAS)

  1. On the Azure storage account, choose Shared access signature in the navigation pane.

  2. In the Allowed services section of the shared access signature pane, select Blob, and clear the other options.

  3. In the Allowed resource types section, select Container and Object, and clear the other options.

  4. In the Allowed permissions section, select Read, Write, Delete, and Create, and clear the other options.

  5. Select a start and end date and time for the SAS. The SAS requires a minimum expiration window of 72 hours from the initiation of the export.

    Tip

    Use near-term expiration for the account's SAS. To reduce risk of a compromised storage account, set the end date and time no later than what you need to complete the database export operation. However, the SAS must be valid for a minimum of 72 hours.

  6. In the Allowed protocols section, select HTTPS only.

  7. Select Generate SAS and connection string.

  8. Copy the Blob service SAS URL.

For more information on generating and using a SAS, see Grant limited access to Azure Storage resources using shared access signatures (SAS).

Creating the database export

After you create the Azure storage account and generate the SAS URI, you can create the export file from the Business Central administration center.

  1. On the Environments list page, choose the relevant environment to view the environment details.
  2. On the action ribbon of the environment details, choose Database, and then choose Create Database Export.
  3. In the File Name field, enter a name for the export file, or accept the default value.
  4. In the SAS URI field, enter the Blob service SAS URL value that you copied in the previous section.
  5. In the Container Name field, enter the name of the container in the Azure storage account where you want to export the BACPAC file. If you already created a container in your Azure storage account, enter the name of that container. Otherwise, if the name you specify in the Container Name field doesn't exist in the Azure storage account, the portal creates it for you.

When the export operation starts, the BACPAC file is generated and exported to the specified Azure storage account. The operation might take several minutes to several hours depending on the size of the database. You can close the browser window with the Business Central administration center during the export. When the export finishes, you can access the export file in the defined container in your Azure storage account. Optionally, you can import the data into a new database in Azure SQL Database or SQL Server for further processing. Learn more in Quickstart: Import a BACPAC file to a database in Azure SQL Database.

Viewing the export history

The system logs all database export activity as environment operation for progress tracking and auditing purposes. To view the history, go to the Operations page in the Business Central administration center.

Users who can export databases

Only specific types of users can export databases: internal and delegated administrators. The following users can export databases.

In addition to an Entra role that grants access to the Business Central administration center, these users must have the D365 BACKUP/RESTORE permission set assigned to their user account in the environment they're trying to export.

Learn more about permission sets and user groups in Assign Permissions to Users and Groups.

Using the exported data

The BACPAC file contains data that's customer-specific business data. Technically, Business Central online is a multitenant deployment, which means that each customer tenant has their own business database while the data that defines the application is in a shared application database.

To export data when moving the customer's Business Central from an online to an on-premises deployment, get the application data from the installation media for the same version as the online tenant. You find the version number in the Business Central administration center or on the Help and Support page in client.

Important

While you can import the downloaded BACPAC file into your own SQL Server instance, Microsoft doesn't provide support for creating a working on-premises environment from the BACPAC that you download from Business Central online.

Learn more in Quickstart: Import a BACPAC file to a database in Azure SQL Database, Migrating to Single-Tenancy From Multitenancy, and When to choose on-premises deployment.

Note

  • If you're getting an error saying your file contains corrupted data when importing the bacpac file, make sure you're using the .NET Core version of SqlPackage.exe.
  • When importing the exported database by using SQL Server Management Studio (SSMS), use the latest version. Earlier versions might not support all scenarios. Learn how to update SSMS in Update SQL Server Management Studio.

Restoring the exported data to Business Central online

If you decide at some point that you want to restore the exported data to a new environment in Business Central online, you must go through the same steps as you went through to migrate from on-premises to Business Central online. This way, you can prepare the database so that it's ready to migrate to the latest version of Business Central. For example, you could choose to replicate the data to a sandbox environment for further testing and training. Learn more in Migrating on-premises data to Business Central online.

Restoring the exported data to a container

If you want to use the exported data in a container-based developer environment, you can use Windows PowerShell scripts to help you do that, including the BCContainerHelper PowerShell module.

SQL Server technical documentation
Quickstart - import a BACPAC file to a database in Azure SQL Database
Delegated administrator access to Business Central online
Working with administration tools
The Business Central administration center
Managing environments
Updating environments
Managing tenant notifications
Introduction to automation APIs