Managing Storage Capacity

Freeing up Dynamics 365 storage space

John PhillipsProduct Updates

Freeing up Dynamics 365 database storage

Before considering deleting key business data, it is worth investigating the deletion of data generated by workflows and other background process. There are seven options to consider:

1 –  Deleting bulk email and workflow instances using a bulk deletion job

Warning
Once these records are deleted, it will no longer be possible to tell if an email was sent via bulk email or if a workflow rule ran against a record. The related emails will however remain intact.
  1. In the affected environment, navigate to Settings > Data Management > Bulk Deletion
  2. Choose New. This opens the Bulk Deletion Wizard.
  3. Choose Next.
  4. In the Look for list, select System Jobs.
  5. In the search criteria area, add criteria similar to the following:
    System Job Type – Equals – Bulk E-mail; Workflow;
    Status Reason – Equals – Succeeded
    Completed On – Older Than X Months – 1
    Your query should look something like this:
    Bulk Email Criteria
  6. Click Next.
  7. On the next screen, give the job a more descriptive name if required. Then select when you would like the job to run; ideally, this would be outside of normal business hours. If you would like the job to run regularly, you can select the Run this job after every x days and either leave it at the default setting of 30 days or select a different period.
  8. Click Next and review the job you have created. If you are happy with all of the settings, click Submit to schedule your deletion job.

2 – Evaluate and delete suspended workflows

There are times when workflows may be ‘stuck’ in a suspended state due to them waiting for criteria that may never be met. This can be due to a flaw in the way the workflow was constructed.

Warning
Some workflows will be in a suspended state because they are waiting for a condition that has not yet been met, which is expected. For example, a workflow may be waiting for a task to be completed.
  1. From within the Dynamics 365 environment, launch Advanced Find.
  2. In the Look for list, select System Jobs.
  3. In the search criteria area, add criteria similar to the following:
    System Job Type – Equals – Workflow
    Status Reason – Equals – Waiting
  4. Choose Results.

In the results window, you can open review each item to determine whether the workflow can be deleted.

3 – Remove bulk duplicate detection jobs and associated copies of duplicate records

Each time that a duplicate detection job runs, a copy of every duplicate record is stored in the database. So if you have 100 duplicate records, every time that you run a duplicate detection job that finds these duplicates, those 100 duplicate records will be stored in the database against the instance of that job until the duplicates are merged or deleted, or until the instance of that duplicate detection job is deleted.

  1. In the affected environment, navigate to Settings > Data Management > Duplicate Detection Jobs
  2. Select the duplicate detection job instances you want to delete and then choose Delete.

To avoid wasting storage space, ensure that duplicate records are resolved promptly, so that they are not reported in multiple duplicate detection jobs.

4 – Delete bulk import instances using a bulk deletion job

Every time you perform a bulk data import, a system job is created and associated with that import. The system job details show which records imported successfully and which records failed.

Warning
After a bulk import job is deleted, you will not be able to see what data was imported and you cannot roll back the import.
  1. In the affected environment, navigate to Settings > Data Management > Bulk Deletion,
  2. Click New to launch the Bulk Deletion Wizard.
  3. Choose Next.
  4. In the Look for list, select System Jobs.
  5. In the search criteria area, add criteria similar to the following:
    System Job Type – Equals – Import
    Status Reason – Equals – Succeeded
    Completed On – Older Than X Months – 1
    Your query should look something like this:
    Bulk Import Criteria
  6. Choose Next.
  7. In the Name text box, type a name for the bulk deletion job.
  8. Select a date and time for the job start time; preferably outside of regular business hours.
  9. Select the Run this job after every check box, and then in the days list, select the frequency you want the job to run.
  10. If you want to receive a notification email when the job completes, select the Send an email to me (moc.n1731055598iamod1731055598@liam1731055598e1731055598) when this job is finished check box.
  11. Choose Next, review the bulk deletion job, and then choose Submit to create the recurring deletion job.

5 – Delete bulk deletion job instances using a bulk deletion job

When deleting data in bulk, a bulk deletion system job is created and can be deleted, post-completion.

Warning
After bulk deletion jobs are deleted, you will lose the history of each job.
  1. In the affected environment, navigate to Settings > Data Management > Bulk Deletion,
  2. Click New to launch the Bulk Deletion Wizard.
  3. Choose Next.
  4. In the Look for list, select System Jobs.
  5. In the search criteria area, add criteria similar to the following:
    System Job Type – Equals – Bulk Delete
    Status Reason – Equals – Succeeded (optionally, failed and cancelled jobs could be included here)
    Completed On – Older Than X Months – 1
    Your query should look something like this:
    Bulk Delete Criteria
  6. Choose Next.
  7. In the Name text box, type a name for the bulk deletion job.
  8. Select a date and time for the job start time; preferably outside of regular business hours.
  9. Select the Run this job after every check box, and then in the days list, select the frequency you want the job to run.
  10. If you want to receive a notification email when the job completes, select the Send an email to me (moc.n1731055598iamod1731055598@liam1731055598e1731055598) when this job is finished check box.
  11. Choose Next, review the bulk deletion job, and then choose Submit to create the recurring deletion job.

Tables and table columns enabled for Relevance Search have an impact on database storage capacity. Microsoft have guides available on amending Relevance Search to reduce data usage:

7  – Delete approval history from Power Automate

Approval data for Power Automate is stored within Microsoft Dataverse. Within an approval, personal information exists in the form of approval assignments and comments included in an approval response. Administrators can access that data by following these steps:

  1. Sign into PowerApps and switch to the required environment.
  2. Select Data, and then select Tables.
  3. If you do not see Flow Approval in the table list, ensure that the selector in the upper-right is set to All.
    Table Selector
  4. Select the ellipsis (…) for the Flow Approval table, and then open the data in Microsoft Excel.
  5. In Microsoft Excel, search, filter, and then delete approval data as required.

Next: Freeing up Dynamics 365 file storage