Media fields are not updated when migrating blobs to Azure Blob Storage


Description

Media fields might not be updated when migrating blobs to Azure Blob Storage. Checking the Media field of media items using the /sitecore/admin/dbbrowser.aspx page shows that the GUID value of this field lacks the "blob://" prefix.

Solution

To resolve the issue:

  1. Replace this code in the Invoke-Migration.ps1 script:
    INSERT INTO @BlobFields ([FieldId]) (
    SELECT [ItemId] FROM [SharedFields] WHERE [FieldId] = 'FF8A2D01-8A77-4F1B-A966-65806993CD31' AND [Value] = '1'
    UNION
    SELECT [ItemId] FROM [VersionedFields] WHERE [FieldId] = 'FF8A2D01-8A77-4F1B-A966-65806993CD31' AND [Value] = '1'
    UNION
    SELECT [ItemId] FROM [UnversionedFields] WHERE [FieldId] = 'FF8A2D01-8A77-4F1B-A966-65806993CD31' AND [Value] = '1'
    UNION
    SELECT [ArchivalId] FROM [ArchivedFields] WHERE [FieldId] = 'FF8A2D01-8A77-4F1B-A966-65806993CD31' AND [Value] = '1'
    );

    with the following code:

    INSERT INTO @BlobFields ([FieldId]) VALUES
    ('{40E50ED9-BA07-4702-992E-A912738D32DC}'),
    ('{DBBE7D99-1388-4357-BB34-AD71EDF18ED3}');
  2. Run the Invoke-Migration.ps1 script.