Best Practices For Deleting Large Sharepoint Lists

The Problem of Large, Outdated SharePoint Lists

As SharePoint lists accumulate items over months and years, they can begin to impact performance and consume substantial storage capacity. Lists with hundreds of thousands or even millions of items will strain the SharePoint database, resulting in sluggish response times for list queries and edits. Large, outdated lists also represent an inefficient use of precious SharePoint disk space allocated for content databases.

While data archiving and retention policies can help curb endless list growth, most organizations will eventually need to permanently delete obsolete lists as part of regular SharePoint stewardship. However, deleting enterprise-scale SharePoint lists presents difficulties compared to smaller list removal. Without proper planning and testing, attempts to purge huge lists may fail due to timeout issues or other errors.

Methods for Identifying Lists to Delete

Choosing which SharePoint lists to delete requires carefully analyzing list metadata and activity over time. SharePoint administrators can employ several techniques to detect unused or dormant lists suitable for removal:

  • Run SharePoint usage reports to pinpoint lists with zero views or edits over a long timeframe, indicating abandonment
  • Query the SharePoint content database directly to identify bloated lists exceeding storage quotas
  • Review last modified dates and item creation trends to find stale lists where new content addition has flatlined
  • Check list associations, owners, and permissions to determine whether a list supports an active business process
  • Compare visibility and membership of site collections and sites to find orphaned or irrelevant lists

These analysis methods help build a defensible rationale for eliminating lists. They also provide audit trail documentation in case questions emerge about why lists were deleted.

Preparing for Deletion with List Settings

Proper preparations must be made before attempting to delete huge SharePoint lists. First, enable list content approval and versioning if available. Content approval creates a moderation and audit trail for all additions and changes. Versioning snapshots allow recovering past states if necessary. These controls also slow list growth rate.

Next, disable any active workflows associated with the list at both the list and site level. This prevents queued workflow instances from encountering errors due to list deletion. Also double check for hidden list dependencies such as columns referenced in other lists which may need to be removed.

Scan site templates and custom solutions for inclusion of the list structure. Lists defined in templates can be automatically recreated. List instances from custom solutions may cause orphaned data issues if not removed prior to list deletion.

Deletion Strategies for Large Lists

Manually deleting extremely large SharePoint lists through the user interface will likely trigger timeout errors and fail to completely purge all items. Robust automation is required to successfully wipe huge list databases.

A batched PowerShell script utilizing the SharePoint Client Side Object Model (CSOM) can reliably shred giant lists. The script can loop through list item ID ranges in chunks of 5,000-10,000 items, invoking the .DeleteObject() method to remove each batch. Built-in error handling with retry logic alleviates temporary connection issues or timeouts.

For greater control over the deletion sequence, SharePoint Designer workflows can iterate through all list rows or a filtered subset and utilize the Remove List Item action. Batch size and throttling settings can be configured to balance performance and reliability for the particular list size.

Clearing Out List Data Without Deleting List

In certain cases, the metadata and structure of a SharePoint list should be retained while purging the actual list content. Before permanently destroying data, administrators may want to export important list items to another archive list or external file system.

SharePoint Designer workflows coupled with the Call HTTP Web Service action can extract list data without permissions issues. For ultimate query flexibility, PowerShell scripts can interact directly with the back-end SQL database to perform complex filtering and backups prior to list truncation.

Database tools like Microsoft’s WideWorldImporters framework can wipe SharePoint list data while retaining schema. This avoids needing to recreate views, columns, permissions, and other list elements.

Post-Deletion Cleanup of Residual Data

Eliminating the visible list database is often not sufficient when purging immense lists. Lingering attachments, list references, and cached artifacts can slowly regenerate storage bloat if left unchecked:

  • Use PowerShell to force garbage collection on the site collections hosting deleted lists to fully purge cached data
  • Scan and remove documents, images, and other files stored in library folders associated with deleted lists
  • Check for and eliminate inclusion of deleted lists in site templates which may restore remnants
  • Examine site programming code like JavaScript or REST endpoints for extraneous list references which should be removed

With large SharePoint farms, sweeping searches across servers may be required to surface all dependencies on deleted lists. Scheduling periodic garbage collection cycles can also aid in catching and cleaning any stray artifacts.

Leave a Reply

Your email address will not be published. Required fields are marked *