Move database from sandbox to development in D365 Finance and Operations
In this blog I am going to demonstrate how to move database from sandbox to development environment.
In some cases, there might be a situation where you need to debug the code with production data. For this, first we need to move database from production to sandbox with refresh database in LCS as shown in below screenshot.
Then we need to move database from sandbox to development as follows.
Steps to move database from Sandbox to Dev
- Login to LCS and click on Sandbox Environment full details.
- On Maintain Tab click Move database.
- To export the Sandbox Database, click on Export Database.
4. You can find the .bacpac file in Database backup of asset library after successfully executing export command . Download the .bacpac file to development VM.
5. Open SSMS in development server. Before importing the database AxDB you must rename the existing AxDB by the following Script.
ALTER DATABASE MyTestDatabase SET SINGLE_USER WITH ROLLBACK IMMEDIATE
ALTER DATABASE MyTestDatabase MODIFY NAME = MyTestDatabaseCopy ;
ALTER DATABASE MyTestDatabaseCopy SET MULTI_USER
6. Right click on Database, select Import Data-tier Application.
7. Click Next.
8. Change the New database name to AxDB and click Next.
9. Click Next and Browse to the folder where .bacpac is downloaded.
10. Click Finish to import database.
11. You can see the Steps as follows.
12. Once Import is done, Open Visual Studio and do Full Synchronization.
I hope this blog will help you.