Refresh database (To-Do list for Data Management BYOD export jobs)

This post will explain what is needed to be performed in target environment when you are planning for refresh database (RDB) process when you use bring your own database (BYOD) export both in source and target environments. In addition, it will clarify how you can re-configure BYOD in target environment after RDB process.

When you use BYOD export in both environments that you are planning for RDB, it is important to take backup of BYOD configuration of target environment so that you can apply it the environment after RDB process. In this regards, following checklist can be used to avoid failing of BYOD export jobs in target environment (e.g. UAT). Please follow To-Do list for task that can be done for RDB process .

Checklist (before RDB):

  • Inform users (D365FO team, data warehouse team, CE team) about RDB start time well in advance.
  • Take a backup of connection string for target environment BYOD entity store (Workspaces > Data management > Configure entity export to database).
  • Create a template of each BYOD data project and export them in your local PC or SharePoint (Workspaces > Data management > Templates). These templates can be imported to the target environment after the RDB.
  • Export published entities to the target environment BYOD in Excel via Excel add-In.
  • Export active BYOD batch jobs in target environment with their recurrence setup.
  •  Stop active BYOD batch jobs controlled or update active period so that they will be stopped before RDB.

Checklist (after RDB):

After RDB, connection string from source environment does not work in target environment and you can evaluate to this delete this BYOD entity store.

Note: You will get an error message by validating the connection string: “The ConnectionString property has not been initialized.The connection string should be of format Data Source=serverName;Initial Catalog=databaseName;Integrated Security=False;User ID=userid;Password=***”.

In order to delete this BYOD entity store (i.e. connection string); you need to perform the following task:

  1. Make sure that BYOD batch jobs are not running and have “Withhold” status.
  2. Just-In-Time access to target environment database via connecting to SQL Server using SSMS via LCS (i.e. No downtime is needed).
  3. Purge “Job history” table and related tables by running SQL Query on AX db. This will cleanup records that are stale in staging and execution history tables For example:
    • DMFDefinitionGroupExecution
  4. Truncate “DMFPublishedEntity” table to drop entities that has been published to the source environment entity store in target environment by running SQL Query on AX db.

Note: After running the truncate query, those entities which have “Published = Yes” will be updated to “Published = No”

  1. Delete all data projects on data management or just delete those relating to source environment BYOD data source.
  1. Delete BYOD entity store connection string.
  1. Delete old BYOD batch jobs (i.e. source environment BYOD batch jobs).
  2. Refresh entity list on the target environment (Workspaces > Data management > Framework parameters):
  1. When the entity list has been refreshed, configure an entity export option for the target environment and then publish the required entities against it.

Note: You need to define correct connection string for target environment.

Note: Click on validate on the BYOD entity store to makes sure that the connection is working.

Useful links:

12 Comments Add yours

  1. Azhar says:

    Can you please advise, how can I find DataEntities for export for Production, Purchase and Sales.
    If I want to create a Data Entity, which “Model” I need to select to see the relevant tables (using Visual Studio).

    Greatly appreciate your help.


    1. Alireza Es says:

      Hi Azhar, If you mean sales order and purchase order, you can use following standard entities:
      -Purchase order headers V2
      -Purchase order lines V2
      -Sales order headers V2
      -Sales order lines V2
      In order to create a custom entities in D365FO, you can follow the steps via following post on Microsoft docs:


      1. Azhar says:

        Dear Ali Reza, thank you so much, actually there entities which are not exposed for OData, so want to do that.
        Secondly for Production Entities, can you provide any insights.
        2) If I want to create New Entities, which MODEL I need to select for Sales, Purchase and Production data.
        3) If any customization is done in Forms, that will also be available in Data Entities, or do we need to created them.?

        Thank you so much.
        best regards


      2. Alireza Es says:

        Hi Azhar, you can use following ODATA entities.
        Have you tried following entities?
        For example: https://D365FOURL/data/PurchaseOrderLinesV2?$filter=dataAreaId='CompanyID
        You can use expand function to get both header and line: https://D365FOURL/data/SalesOrderHeaders?$filter=SalesOrderNumber eq ‘SO-000001’$expand=SalesOrderLine
        2)Do you mean to use own package model?
        It’s possible to copy an entity and using “Duplicate in project” in Visual Studio.
        If you want to add new fields to standard data entity, you can Instead of duplicating the data entity, you can create a new model and new solution with a project where you can create an extension on top of the standard data entity. You are able to add fields using an extension.
        3)The new new custom entity will be available in the environment once you refresh data entities.


      3. Azhar Hussain says:

        Dear Ali Reza
        The below are visible and I can extract data

        But ProductionOrderHeader is not visible, please advise.

        Secondly as question previously, using Visual Studio, (SSDT), I want to expose any entity which does not seem visible. How I can do that. Which MODEL selection would give me access to those list of entities.??

        Thank you so much for your responses.
        Best regards


      4. Alireza Es says:

        You need to choose ODATA entity ProductionOrderHeaders (https://D365FOURL/Data/ProductionOrderHeaders)


      5. Azhar Hussain says:

        below links are not working for me.

        Please advise.


      6. Alireza Es says:

        Hi Azhar, Please try
        https://D365FOURL/data/PurchaseOrderLinesV2?$filter=dataAreaId eq ‘CompanyID‘


      7. Azhar Hussain says:

        Thanks, these are the ones I have been using. But for entity to be exposed for odata, which MODELS, I need to select in visual studio to create.


      8. Alireza Es says:

        Hi Azhar, You need to use the same model that the original entity has. For example, you can use “Application suite” for Sales order line V2:


      9. Azhar Hussain says:

        Greatly appreciated, thanks and best regards


  2. Azhar Hussain says:

    Thanks, by the way the links are not working still.

    This domain is not being resolved by DNS (D365fourl)


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s