0

We have installed the Content Hub connector in Sitecore 10.2 with Content Hub 5.0. Now there is one requirement from the client that all the media available in the Sitecore should be migrated to the Content Hub DAM and then all the Sitecore links should follow the Content Hub media's URL after migration.

So, does someone have any idea of how to migrate the media to the Content hub and then update the references of media in Sitecore fields to follow the DAM media's URL?

1 Answer 1

5

You can export Media files in CSV format and upload them into the Content hub.

Step 1:

Sitecore Media Library Export to CSV:PowerShell extensions script to help export the media library assets file names and path to a spreadsheet.

    $everythingUnderMediaLibrary = Get-Item master: -Query 
    "/sitecore/media library//*" 
    $outputFilePath = "C:\Media_Library_Export.csv" 
    #Create an empty csv file and paste the path here $results = @();    $everythingUnderMediaLibrary | ForEach-Object {
     $properties = @{
        ItemID = $_.ID
        Name  = "$($_.Name)"
        ItemPath = "$($_.ItemPath)"
        Extension  = "$($_.Extension)"
        Title  = $_.Title
        Alt_text  = $_.Alt
        Template = $_.TemplateName   }
     $results += New-Object psobject -Property $properties 
     }    
     $Results | Select-Object ItemID,Name,ItemPath,Extension,Title,Alt_text,Template | Export-Csv
    -notypeinformation -Path $outputFilePath

For reference : https://madhuanbalagan.com/migrate-sitecore-media-library-assets-to-dam

Step 2: Create Taxonomy in Content hub Instance Create Taxonomy/ Option List as per business requirements in Content hub.

enter image description here

Step 3: Update Excel data as per Taxonomy Update Column name in the exported sheet as per Taxonomy name

Update all data in excel according to the Taxonomy's value Identifier. For example:

enter image description here

enter image description here

Also, Rename the Name of Excel sheet (Name should be always "M.Asset")

enter image description here

Step 4: Upload Assets in Content hub through Import Excel

enter image description here

Step 5: Install Connector in Sitecore Instance (as per Sitecore version and content hub instance version) Before installing the Connector Package, you need to add Sitecore url in Content hub Settings.

Go to Manage > Settings > Portal Configuration > CORSConfiguration

See below example:

enter image description here

After Installation of Connector in Sitecore instance, you can see new browser link "Browse Sitecore DAM".

enter image description here

Step 6: Run PowerShell Script in Sitecore to change the pointing URLs of images / Rich Text

Step 7: Check new URL in Sitecore Now you can search any Image /PDF /Rich Text item. The URLs should be changed and pointing to Content hub URL.

For Example:

enter image description here

Sitecore Path: /sitecore/content/Global/Components/Rich Text/IND Get Started/Tools and Resources

New URL: https://ch-p-001.sitecorecontenthub.cloud/api/public/content/e9df763864af41ba8ecf6ed2e1f525ea

Old Sitecore URL: https://sitecoreinstance/-/media/sitecore/pdf-documents/individual/1848831_gettingstarted_ind_id.ashx

For reference: https://www.altudo.co/insights/blogs/how-to-migrate-assets-from-sitecore-media-library-to-content-hub

7
  • don't forget to mention the original content : altudo.co/insights/blogs/… Oct 16, 2023 at 8:57
  • 1
    @VladIobagiu yeah I did, thanks Oct 16, 2023 at 9:00
  • @GauravAgarwal I did not understand the part of the answer about how the script will check the media reference available in the Sitecore field is to be replaced with which media in the Content Hub Oct 16, 2023 at 9:44
  • if you are moving all the assets to Content hub then you can simply create a Powershell script replace the url to Content Hub media asset URL, as initial url will be same for all the assets (the hostname) Oct 16, 2023 at 11:09
  • @GauravAgarwal I followed the approach but not sure in your answer what is the use of the zip downloaded using Powershell script and how uploading the Excel can upload the asset. Oct 26, 2023 at 12:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.