How to apply database backup from LCS to your D365FO DevBox environment?

Do you want to update your devBox with the latest data from another environment? In this article, we are going to talk about how to apply a database back-up (.bak file) from LCS to your D365FO DevBox environment.

  1. Log in to your DevBox where you want to apply the DB back up
  2. Sign in to LCS https://lcs.dynamics.com
  3. Select the project that has the DB back-up you want to apply

    LCS Project

  4. Click on the burger icon and choose Asset Library

    Asset Library

  5. Click on "Database backup" then choose the database backup you want to download and click on it.

    select the database backup file to download from LCS

  6. The download will start for the backup file of type (.bak) 

    Download the database backup file from LCS

  7. I saved this file in my devBox in J drive, under a new folder called LCS backup

    Save database file locally

  8. Before proceeding, It's better to close Visual studio and stop the following services: DMF, Batch, Management reporter and SQL reporting services.
  9. Open "Microsoft SQL server management studio" and click connect

    connect to SQL service management studio

  10. Expand the "databases" node in object explorer, and choose AxDB

    Expand SQL databases and choose AxDB

  11. Before applying the new DB backup, we can take a backup of the existing DB just in case. You can do that by right clicking on AxDB, selecting "Tasks" then "Back up"

    Take backup of the existing database

  12. Click "Ok" (As you can see in the image below, Destination is Disk and the path to save the original DB backup is in J drive which you can change as you wish)

    Save original Database backup

  13. Once the backup is finished, you'll get this message

    Original Database backup is succesful

  14. Now you can apply the new backup file (.bak) that you downloaded from LCS  and restore it directly on AxDB.
    Right click on AxDB and click Tasks -  restore - Database

    Database restore

    • Under "Source" choose Device, then click on the three dots next to it

      Restore DB and choose device

    • Click on Add

      Add backup

    • Choose the .bak file you download from LCS, then click Ok
      Choose Database backup file you download from LCS

    • Click Ok

      Ok

    • As you can see, all fields are now filled,  you can now click on options in the left pane

      Options

    • In options, mark the following two fields as true: "Overwrite the existing database (With replace) and "close existing connections to destination database". Then click Ok.

      Overwrite the existing database and close existing connections to destination database

  15. You'll get a message now that the DB is restored successfully
  16. Open visual studio and synchronize the database
  17. After the sync finishes, you can now navigate to the tables to check if the data you want is now appearing

Comments

Popular Posts

How to update D365FO environments to a new Microsoft version?

How to create a new D365FO cloud-hosted environment?