Dynamics 365 for Finance and Operations Database Transfer

In Dynamics 365 for Finance and Operations projects, it can happen that data is copied between different environments. There are all kinds of reasons why…

In Dynamics 365 for Finance and Operations projects, it can happen that data is copied between different environments. There are all kinds of reasons why the data has to be copied from one environment to another. The most common is certainly to create a new test environment. Compared with earlier Microsoft Dynamics AX versions, where the underlying data was usually accessible via a Microsoft SQL Server, in Dyn365FO the data is stored in an Azure SQL Database. This applies at least from so-called Tier-2 environments onwards, which consist of several application servers. Use of the different environment configurations (Source: Microsoft) Microsoft Dynamics LCS (Lifecycle Services) has provided tools for several months now for copying data between environments. It works reliably, but only for Tier-2 environments. It becomes more problematic when the data is needed for development or testing on Tier-1 environments. Environment management in LCS In this case, you can still create the Azure DB backup in LCS, but the database restore still takes place in the Tier-1 environment as before. The backup is no longer stored in a *.bak file but in a file with the extension *.bacpac. This file must be downloaded from LCS into the target environment and imported into SQL Server using the SqlPackage.exe command. Afterwards, you start an update script, rename the DB and can then use the environment with the copied data. Because Azure DB and SQL Server are two different products and functions are used that are not supported in both products, problems sometimes occur during the restore or update script. In this case, it must be identified which the problematic objects in the Azure DB are (based on the error log during the import). After that, a database copy has to be created, the problematic objects deleted and the database export created manually. In the past, manual export was the only possible way to copy data between different environments. Since Microsoft made the functionality f