The asset metadata sync in Acquia DAM lets you sync asset metadata field mappings to all existing DAM media entities of a specific media type. This ensures existing media items reflect updated configuration settings without manually editing each asset.
Unlike the acquia-dam:update-assets command, which performs a comprehensive update of asset versions, media status, and other general information, the metadata sync focuses specifically on refreshing metadata field mappings.
Use metadata sync when:
You have added new field mappings to a media type configuration and need existing media items to reflect the new mappings.
You have changed the metadata field mapping configuration and need to update all existing media items.
You need to refresh metadata on media items.
Note
If you need to fetch broader asset updates—such as new file versions, media status changes, or general asset information—use the acquia-dam:update-assets command instead.
How the metadata sync process works
Understanding how metadata sync operates helps you choose the right method and options.
When metadata sync runs, the system performs the following:
Identifies all media entities of the specified media type that have a DAM asset ID.
Invalidates the DAM asset cache for each entity to ensure fresh data is retrieved from the API.
Fetches the current metadata for each asset from Acquia DAM.
Re-applies all configured field mappings through the event dispatcher. This allows any registered event subscribers to modify metadata values before they are saved to the entity.
Updates the changed timestamp and saves the entity.
Key differences from asset sync:
Metadata sync does not update asset versions or file references.
Metadata sync does not change media publish or unpublish status.
Metadata sync does not run automatically through cron. It must be triggered manually through the user interface or Drush.
Manual synchronization methods
You can trigger asset metadata synchronization manually when you need immediate sync for specific assets.
Through the user interface
Sync metadata from the media list page:
In the administrative menu, select Content.
Select Media to view all media items.
Select Sync metadata.
The system fetches the latest asset metadata from Acquia DAM and re-applies the configured field mappings to the selected media items.
Through Drush commands
The acquia-dam:asset-metadata-sync command iterates through all existing media entities of a specified media type and re-applies the configured metadata field mappings. It fetches the current metadata for each asset from the Acquia DAM API and applies the latest configuration.
Run the metadata sync command to re-apply field mappings for a specific media type:
This resumes from the last processed position, processes up to 200 items, and processes them in batches of 75.
Options:
--batch-size: Number of media items to process per batch. Default: 50.
--limit: Maximum number of media items to process. Default: 0 (no limit).
--offset: Number of media items to skip before processing. Default: 0.
--resume: Resume from the last processed media ID stored in Drupal state. Default: FALSE.
Examples:
# Re-apply metadata mappings to all image assets:
drush acquia-dam:asset-metadata-sync acquia_dam_image_asset
# Process only video assets with a larger batch size:
drush acquia-dam:asset-metadata-sync acquia_dam_video_asset --batch-size=100
# Skip the first 50 items and process the next 100:
drush acquia-dam:asset-metadata-sync acquia_dam_image_asset --limit=100 --offset=50
# Resume processing from the last interrupted position:
drush acquia-dam:asset-metadata-sync acquia_dam_image_asset --resume
Resume and interruption handling
If the command is interrupted (for example, due to a server timeout or manual cancellation), you can resume from the last processed position using the --resume option.
When --resume is enabled:
The command stores the last processed media entity ID in Drupal state after each batch.
On the next run with --resume, the command queries only media entities with an ID greater than the last processed ID.
This ensures that previously processed items are not re-processed.
Example workflow for resuming an interrupted sync:
The --resume flag stores progress in Drupal state using the key acquia_dam.metadata_sync.last_processed_id. This state is cleared when you run the command without the --resume flag.
How do I sync asset metadata in Acquia DAM?
The asset metadata sync in Acquia DAM lets you sync asset metadata field mappings to all existing DAM media entities of a specific media type. This ensures existing media items reflect updated configuration settings without manually editing each asset.
Unlike the acquia-dam:update-assets command, which performs a comprehensive update of asset versions, media status, and other general information, the metadata sync focuses specifically on refreshing metadata field mappings.
Use metadata sync when:
You have added new field mappings to a media type configuration and need existing media items to reflect the new mappings.
You have changed the metadata field mapping configuration and need to update all existing media items.
You need to refresh metadata on media items.
Note
If you need to fetch broader asset updates—such as new file versions, media status changes, or general asset information—use the acquia-dam:update-assets command instead.
How the metadata sync process works
Understanding how metadata sync operates helps you choose the right method and options.
When metadata sync runs, the system performs the following:
Identifies all media entities of the specified media type that have a DAM asset ID.
Invalidates the DAM asset cache for each entity to ensure fresh data is retrieved from the API.
Fetches the current metadata for each asset from Acquia DAM.
Re-applies all configured field mappings through the event dispatcher. This allows any registered event subscribers to modify metadata values before they are saved to the entity.
Updates the changed timestamp and saves the entity.
Key differences from asset sync:
Metadata sync does not update asset versions or file references.
Metadata sync does not change media publish or unpublish status.
Metadata sync does not run automatically through cron. It must be triggered manually through the user interface or Drush.
Manual synchronization methods
You can trigger asset metadata synchronization manually when you need immediate sync for specific assets.
Through the user interface
Sync metadata from the media list page:
In the administrative menu, select Content.
Select Media to view all media items.
Select Sync metadata.
The system fetches the latest asset metadata from Acquia DAM and re-applies the configured field mappings to the selected media items.
Through Drush commands
The acquia-dam:asset-metadata-sync command iterates through all existing media entities of a specified media type and re-applies the configured metadata field mappings. It fetches the current metadata for each asset from the Acquia DAM API and applies the latest configuration.
Run the metadata sync command to re-apply field mappings for a specific media type:
This resumes from the last processed position, processes up to 200 items, and processes them in batches of 75.
Options:
--batch-size: Number of media items to process per batch. Default: 50.
--limit: Maximum number of media items to process. Default: 0 (no limit).
--offset: Number of media items to skip before processing. Default: 0.
--resume: Resume from the last processed media ID stored in Drupal state. Default: FALSE.
Examples:
# Re-apply metadata mappings to all image assets:
drush acquia-dam:asset-metadata-sync acquia_dam_image_asset
# Process only video assets with a larger batch size:
drush acquia-dam:asset-metadata-sync acquia_dam_video_asset --batch-size=100
# Skip the first 50 items and process the next 100:
drush acquia-dam:asset-metadata-sync acquia_dam_image_asset --limit=100 --offset=50
# Resume processing from the last interrupted position:
drush acquia-dam:asset-metadata-sync acquia_dam_image_asset --resume
Resume and interruption handling
If the command is interrupted (for example, due to a server timeout or manual cancellation), you can resume from the last processed position using the --resume option.
When --resume is enabled:
The command stores the last processed media entity ID in Drupal state after each batch.
On the next run with --resume, the command queries only media entities with an ID greater than the last processed ID.
This ensures that previously processed items are not re-processed.
Example workflow for resuming an interrupted sync:
The --resume flag stores progress in Drupal state using the key acquia_dam.metadata_sync.last_processed_id. This state is cleared when you run the command without the --resume flag.
Did not find what you were looking for?
If this content did not answer your questions, try searching or contacting our support team for further assistance.
Did not find what you were looking for?
If this content did not answer your questions, try searching or contacting our support team for further assistance.