This post has been republished via RSS; it originally appeared at: New blog articles in Microsoft Community Hub.
This week, I've been working on a service request case where we need to export multiple databases using SqlPackage. Following, I would like to share my lesson learned to export simultaneous several databases, saving the export files to the F:\sql folder and the logs of the operations to the F:\sql\log folder.
Few recommendations when performing these exports:
- Enable Accelerated Networking: This enhances data transfer performance.
- Virtual Machine:
- Be in the same region of the server.
- The virtual machine needs to have enough space in the
%temp%
folder for the temporary files generated during the process. Lesson Learned #21: There is not enough space on the disk exporting BacPac using SSMS - Microsoft Community Hub - The machine should have sufficient CPU capacity, ideally between 4 to 8 CPUs, depending on the volume of operations.
- Use SSD or Premium storage for better performance.
Disclaimer
The script provided above is intended for illustrative purposes only. Before using it in a production environment, thoroughly review and test the script to ensure it meets your needs and adheres to your organization's security and operational policies. Always safeguard sensitive information such as credentials and server details.
Also, remember that sqlpackage exports the data but does not guarantee transactional consistency. You will find more details about here: Using data-tier applications (BACPAC) to migrate a database from Managed Instance to SQL Server - Microsoft Community Hub