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:
- Backup Creation:
- Use the Data Management framework to export the Batch History table data to a data package.
- Navigate to Data Management > Export.
- Create a new export project and add the Batch History table to the project.
- Configure the export settings and run the export job to generate the data package.
- Save the exported data package to a secure location, such as Azure Blob Storage or another secure storage solution.
- Cleanup Process:
- Go to Data Management > Job History Cleanup.
- In the Job History pane, set the Number of days to retain history to 30 days.
- Specify the Number of hours to execute the job and configure the Batch job recurrence fields.
- Schedule the job to run regularly in the background by selecting the Batch processing field.
- Define a recurrence by selecting Recurrence, and then, in Recurrence definition, select No end date.
- Execution Timing:
- Coordinate with the customer to determine a suitable time for executing the cleanup script, considering the potential for slowness during batch processing.
- Approval for Truncate:
- 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.
- Monitoring:
- Keep the customer updated about the progress of the cleanup and backup processes, and confirm once the cleanup has been successfully completed.
