Magento 2: Images of old image gallery not showing in new media gallery

The new/enhanced media gallery was announced with the release of Adobe Commerce and Magento Open Source 2.4.

Enable New Media Gallery

STORES > Settings > Configuration > ADVANCED > System > Media Gallery

Set
Enable Old Media Gallery = No

This will then enable the new media gallery.

Access New Media gallery

CONTENT > Media Gallery

Table of Contents

Problem:

Images of old image gallery not showing in the new media gallery (CONTENT > Media Gallery)

Solution:

The Magento doc says that:

Full functionality for new Media Gallery requires media.gallery.synchronization and media.content.synchronization queue consumers to be started for initial synchronization

1) Run the following media sync commands

Synchronize content with assets


bin/magento media-content:sync

Synchronize media storage and media assets in the database


bin/magento media-gallery:sync

Note: If you have a large number of images, then the media-gallery:sync can take some time to complete.

2) Start the following message queue consumers


bin/magento queue:consumers:start media.content.synchronization
bin/magento queue:consumers:start media.gallery.synchronization

If there is a large gallery item to sync, then it might take some time.

In such a case, you can run the commands in the background by appending “&” at the end of the command.


bin/magento queue:consumers:start media.content.synchronization &
bin/magento queue:consumers:start media.gallery.synchronization &

Bonus:

Some references on managing message queues:

List all consumers


bin/magento queue:consumers:list

Start message queue consumers


bin/magento queue:consumers:start [--max-messages=<value>] [--batch-size=<value>] [--single-thread][--area-code=<value>] <consumer_name>

To run message queue in the background, you can append & at the end:


bin/magento queue:consumers:start <consumer_name> &

Hope this helps. Thanks.