Understanding BACPAC
BACPAC is something technical people will encounter when working with Microsoft Dynamics D365 Finance and Supply Chain Management (D365F&SCM). It is the backup file created by Azure for D365F&SCM environments. The BACPAC is not exclusive to Azure; it has been available to SQL servers since version 2012.
The Definition of BACPAC
BACPAC is a file format used to bundle SQL Server databases and their related configurations into a single file. A BACPAC file contains the database schema, data, stored procedures, functions, and other database objects. It’s a reliable way to package a database for moving between on-premises and cloud environments and for sharing databases with others.
Life Cycle Services (LCS) and BACPAC
When managing D365F&SCM environments, copying an environment from one instance to another is important. The only way to copy a production environment to another instance is by using LCS, which only generates the BACPAC file. This means you have no option but to use this file to update tier 1 hosted instances or on-site instances with copies of hosted production or hosted tier 2 (or higher) instances.
How to Export a BACPAC for D365F&SCM
Exporting Data as BACPAC (hosted Tier 2 or higher)
To export data as a BACPAC file, you can follow these simple steps:
- Open an internet browser and connect to https://lcs.dynamics.com.
- Log into your account.
- Open the project that represents the client system.
- On the right side of the project screen, you will find all the tier 2 (or higher) environments.
- Select “Full Details” for the environment you want to create the BACPAC file.
- Select the menu option “Maintain”, then select “Move Database”.
- Select “Export database”.
- Then confirm the request. It will create the BACPAC file in the LCS project asset library under the “database backup”.
Once the process is complete, you will have a BACPAC file containing the exported data.
Exporting Data as BACPAC (hosted Tier 1 or on-site)
To export data as a BACPAC file, you can follow these simple steps:
- Open SQL Server Management Studio from the instance server and connect to the database instance containing the data you want to export.
- Right-click the database and select Tasks > Export Data-tier Application.
- Click Next and select the objects you want to export.
- Choose a destination for the BACPAC file and click Next.
- Review the summary and click Finish to start the export process.
Once the process is complete, you will have a BACPAC file containing the exported data.
How to Import a BACPAC for D365F&SCM
Importing Data from BACPAC (hosted Tier 2 or higher)
To import data from a BACPAC file, you can follow these simple steps:
- Open an internet browser and connect to https://lcs.dynamics.com.
- Log into your account.
- Open the project that represents the client system.
- On the right side of the project screen, you will find all the tier 2 (or higher) environments.
- Select “Full Details” for the environment you want to create the BACPAC file.
- Select the menu option “Maintain”, then select “Move Database”.
- Select “Import database”.
- Select the BACPAC to be imported. This must be in the LCS project asset library under the “database backup”.
Once the process is complete, your import will be complete.
Importing Data from BACPAC (hosted Tier 1 or on-site)
To import data from a BACPAC file, you can follow these simple steps:
- Download the BACPAC file from the project asset library to the local server.
- Ensure the SQLPackage software is installed on the server: https://learn.microsoft.com/en-us/sql/tools/sqlpackage/sqlpackage-download?view=sql-server-ver16#get-sqlpackage-net-core-for-windows
- Open a windows command prompt in administrator mode.
- Navigate to the SQLPackage directory.
- Use the following command to import the BACPAC file
SqlPackage.exe /a:import /sf:D:\Exportedbacpac\my.bacpac /tsn:localhost /tdn:<target database name> /p:CommandTimeout=1200 /TargetTrustServerCertificate:true
Once the process is complete, your import will be complete.
Conclusion
BACPAC is an essential tool for D365F&SCM technical users, enabling the data to be copied from one instance to another. This will allow testing, UAT, training and development environments to have current data, which is a critical part of the full life cycle of your D365F&SCM ecosystem.
*This post is locked for comments