CLI commands

Command Description

pacemaker:import-media:init

To correctly check when an image has changed when importing images or videos through the media import, the modified_at date has got introduced for images.

The CLI command pacemaker:import-media:init can get used to set the update date of all images.

It should be executed only once initially
  • The filter option gets used to restrict the file names concerning the setting of the update date

  • The filter option is useful for a reset of certain files because the filter is a like-condition in the DB for the names of the images

  • If the command gets executed, the modified_at field, e.g., in the catalog_product_entity_media_gallery table, is set accordingly

Initialization for media import

Example - No filter

Command
Execution pacemaker:import-media:init without filter
bin/magento pacemaker:import-media:init
Output
Initialize product media gallery data for Pacemaker import
100/100 [============================] 100% < 1 sec 86.5 MiB    | /f/e/fe9fc289c3ff0af142b6d3bead98a923.jpg
Media gallery images initialized successfully for Pacemaker import

Example - With filter

Command
Execution of the CLI command pacemaker:import-media:init with additional filter
bin/magento pacemaker:import-media:init -f <<FILTER>> (1)
1 The filter option restricts the file paths/filenames of the image/media files during import.
Example
bin/magento pacemaker:import-media:init -f /c/9/ (1)
1 The filter option restricts the file paths/filenames of the image/media files during import.
Output
Display description
Initialize product media gallery data for Pacemaker import- with filter option "/c/9/".
1/1 [============================] 100% < 1 sec 84.5 MiB	| /c/9/c9f0f895fb98ab9159f51fd0297e236d.jpg
Media gallery images initialized successfully for Pacemaker import