Skip to content

Version 4.x Migration

Dawid Potgieter edited this page Oct 7, 2018 · 5 revisions

Version 4.x Migration

  • Install and configure the plugin solution in CRM (v4.1 Setup).
  • You can let the migration tool handle disabling/enabling the correct plugin steps (Automatically Enable/Disable BinaryStorageOptions plugin checkbox) OR manual :

Open the Plugin Registration tool in the CRM SDK and disable all BinaryStorageOption steps.

If you have any other plugins on Retrieve, RetrieveMultiple, Create, Update of annotation or activitymimeattachment, it is totally recommended to disable those as well. The CRM sandbox service just falls over if you don't after a while.

Remember to re-enable these steps or the plugin won't work

!!! If you are running the source code version, you should probably update the CRM SDK to latest version, as that's required for Dynamics online. !!!

  • Provide the server name and credentials (for AD, it uses the account that you run the migration tool as)
  • Click "Connect". This will check your connection with CRM and retrieve the BinaryStorageOptions configuration from CRM.
  • Provide your azure storage account name and the account key. If you've set AES256 encryption, you also need to provide the same encryption key and salt values. (This will now be read from the settings and you don't have to provide it)
  • Pick migration direction
    • CRM -> External : Blobs will be moved to the outside storage provider
    • External -> CRM : Blobs will be moved FROM the outside storage provider back into CRM
    • "Move Annotations External" option will MOVE annotations instead of COPYing them. If you're happy to use this option, you don't need to run the SQL script below. See notes.
  • Pick ThreadCount (the amount of concurrent connections (IOrganizationService) to CRM and storage provider).
  • Wait Delay : It waits every now and then to give CRM a breather.
  • Click "Migrate".
  • You can click cancel any time, it will stop as soon as it can

Notes

  • The v4.1 migration tool MOVES attachments, but only copies annotation binaries externally, unless you select the "Move Annotations External" option. If you want to keep the annotation filesizes of annotations when migrating externally, do not use the "Move Annotations External" option, but you have to run the following script on your CRM sql database afterwards :
UPDATE [CRM_MSCRM].[dbo](dbo).[AnnotationBase]
SET [DocumentBody] = 'IA=='
WHERE [IsDocument] = 1

Or if the transaction logs get full when doing the update, you can try this pattern :

SET NOCOUNT ON;
 
DECLARE @id UNIQUEIDENTIFIER
DECLARE @count INT

DECLARE c CURSOR  
FOR SELECT [AnnotationId] FROM [AnnotationBase] WHERE [IsDocument] = 1

OPEN c
FETCH NEXT FROM c
INTO @id

SET @count = 0;

WHILE @@FETCH_STATUS = 0
BEGIN
	UPDATE [CRM_MSCRM].[dbo].[AnnotationBase]
	SET [DocumentBody] = 'IA=='
	WHERE [AnnotationId] = @id

	PRINT @count
	SET @count = @count + 1

	FETCH NEXT FROM c INTO @id
END

CLOSE c;
DEALLOCATE c;