Views:

Applies to Product - Dynamics 365 Finance


What’s happening?
The customer requested a backup and cleanup of the Batch History table in the production environment for a specific application, aiming to retain only the last 30 days of data.
 

Reason:
The cleanup process was hindered by the size of the Batch History table, which led to timeout errors during execution. The customer was concerned about losing historical data if a full truncate was performed.
 

Resolution:

  1. Backup Creation:
  2. Use the Data Management framework to export the Batch History table data to a data package.
  3. Navigate to Data Management > Export.
  4. Create a new export project and add the Batch History table to the project.
  5. Configure the export settings and run the export job to generate the data package.
  6. Save the exported data package to a secure location, such as Azure Blob Storage or another secure storage solution.
  7. Cleanup Process:
  8. Go to Data Management > Job History Cleanup.
  9. In the Job History pane, set the Number of days to retain history to 30 days.
  10. Specify the Number of hours to execute the job and configure the Batch job recurrence fields.
  11. Schedule the job to run regularly in the background by selecting the Batch processing field.
  12. Define a recurrence by selecting Recurrence, and then, in Recurrence definition, select No end date.
  13. Execution Timing:
  14. Coordinate with the customer to determine a suitable time for executing the cleanup script, considering the potential for slowness during batch processing.
  15. Approval for Truncate:
  16. If a truncate operation is necessary, obtain customer approval, ensuring they understand that this will result in the loss of all historical data in the Batch History table.
  17. Monitoring:
  18. Keep the customer updated about the progress of the cleanup and backup processes, and confirm once the cleanup has been successfully completed.
If any issues arise during the execution of these steps, further assistance may be required.