Створіть файл test.php у корені Magento 2, помістіть у нього код:
<?php error_reporting(E_ALL); ini_set('display_errors', 1); use Magento\Framework\App\Bootstrap; require __DIR__ . '/app/bootstrap.php'; define('SOURCE_MEDIA_URL', 'https://livestore.com/pub/media/'); //замініть це!!! $bootstrap = Bootstrap::create(BP, $_SERVER); $obj = $bootstrap->getObjectManager(); $state = $obj->get(Magento\Framework\App\State::class); $state->setAreaCode('frontend'); $object = $obj->get(\Magento\Catalog\Model\ResourceModel\Product\Action::class); $connection = $object->getConnection(); $mediaGallery = $connection->getTableName('catalog_product_entity_media_gallery'); $fileSystem = $obj->create(\Magento\Framework\Filesystem::class); $mediaPath = $fileSystem->getDirectoryRead(\Magento\Framework\App\Filesystem\DirectoryList::MEDIA)->getAbsolutePath() . 'catalog/product'; $select = $conn