Clio has an integration with NetDocuments that creates folders in NetDocuments linked to Matters in Clio. If a client making use of this integration wants to move their documents from NetDocuments to being stored in Clio you can use this procedure.
First backup NetDocuments to a Universal Database using Universal Migrator
The SQL statement below will create a reusable function that can back up the Clio Client and Matter Id from a string.
- --This function extracts the Clio Client and Matter from a value
- CREATE OR ALTER FUNCTION Extract_Clio_Id(
- @Id NVARCHAR(MAX)
- ) RETURNS @RESULT TABLE(
- ClientId NVARCHAR(MAX),
- MatterId NVARCHAR(MAX)
- ) AS BEGIN
- DECLARE @VALUES NVARCHAR(MAX) = @Id
- DECLARE @SEPARATOR CHAR = '|'
- --Remove the Clio- Prefixens
- SET @VALUES = REPLACE(@Values, 'Clio-', '')
- SET @VALUES = REPLACE(@VALUES, ' --- ', @SEPARATOR)
- DECLARE @CLIENTID NVARCHAR(MAX) = (SELECT COALESCE(value, '') from STRING_SPLIT(@VALUES, @SEPARATOR, 1) WHERE ordinal = 1)
- DECLARE @MATTERID NVARCHAR(MAX) = (SELECT COALESCE(value, '') from STRING_SPLIT(@VALUES, @SEPARATOR, 1) WHERE ordinal = 2)
- INSERT INTO
- @RESULT(ClientId, MatterId)
- VALUES
- (@CLIENTID, @MATTERID)
- RETURN
- END
- GO
The following SQL statement will back up the Contact Id and UPDATE the Result_Id on the __M_Contacts table
- --Update Result_Id to the correct contact ID in Clio
- UPDATE
- __M_Contacts
- SET
- Result_Id = (SELECT ClientId FROM Extract_Clio_Id(Id))
- WHERE 1=1
- AND Id like 'Clio-%'
- --Update Result_Id to the correct matter ID in Clio
- UPDATE
- __M_Matters
- SET
- Result_Id = (SELECT MatterId FROM Extract_Clio_Id(Id))
- WHERE 1=1
- AND Id like 'Clio-% --- Clio-%'
The following script will set the Final_Status to "Deleted" for Contacts that exist in NetDocuments, but aren't linked to Clio. This tells Universal Migrator to disregard these contacts.
- --For Contacts that don't exist in Clio, mark them Deleted so UM will disregard them.
- UPDATE
- __M_Contacts
- SET
- Final_Status = 'Deleted'
- WHERE 1=1
- AND Result_Id = ''
The following script will set the Final_Status to "Deleted" for Matters that exist in NetDocuments, but aren't linked to Clio. This tells Universal Migrator to disregard these matters.
- --For Matters that don't exist in Clio, mark them Deleted so UM will disregard them.
- UPDATE
- __M_Matters
- SET
- Final_Status = 'Deleted'
- WHERE 1=1
- AND Result_Id = ''
If the client wants document categories converted to folder paths (most do), run this command.
If there are documents in NetDocuments that are orphaned from a matter, please reference the article named Synthesize: Missing Matters for Documents for instructions on synthesizing Matters for documents orphaned from Matters.
You may also have Matters that are orphaned from contacts. The article named Synthesize: Missing Client Contacts for Matters has instructions for synthesizing contacts for Matters that are orphaned from a Contact record.