The following scripts provide examples that can be modified to apply different priorities to documents.
If you are restoring into a system that has different action limits at different times, this can help you optimize throughout.
Big documents should be prioritized when action limits are small and small documents should be prioritized when action limits are big.
- --Prioritize documents based on size.
- UPDATE
- __M_Documents_Digital_Files
- SET
- Batch_Number = -100
- WHERE 1=1
- AND Id IN (
- SELECT
- Final_DocumentFile_Id
- FROM
- __M_Documents_Digital_Files_Versions
- WHERE 1=1
- --Change this to be < or > depending on what you want.
- AND Final_ContentSize < 10 * 1024 * 1024 -- 10MB
- AND Result_Id = ''
- )
When restoringg giant amounts of documents, it can be helpful to firms if documents for open matters get transferred first. This script does that.
- --Prioritize documents for open matters.
- UPDATE
- __M_Documents_Digital_Files
- SET
- Batch_Number = -100
- WHERE 1=1
- AND Result_Id = ''
- AND Final_Parent_Id IN (
- SELECT
- Id
- FROM
- __M_Matters
- WHERE 1=1
- AND Final_Status = 'Active'
- )
- --Prioritize documents for specific matters.
- UPDATE
- __M_Documents_Digital_Files
- SET
- Batch_Number = -100
- WHERE 1=1
- AND Result_Id = ''
- AND Final_Parent_Id IN (
- SELECT
- Id
- FROM
- __M_Matters
- WHERE 1=1
- AND Final_ReferenceCode IN (
- 'ABC-001',
- 'ABC-002'
- )
- )
- UPDATE
- __M_Documents_Digital_Files
- SET
- Batch_Number = -1
- WHERE 1=1
- AND Id IN (
- SELECT
- Final_DocumentFile_Id
- FROM
- __M_Documents_Digital_Files_Versions
- WHERE
- Result_Id = ''
- )
- UPDATE
- __M_Documents_Digital_Files
- SET
- Batch_Number = -1
- WHERE 1=1
- AND Result_Id = ''