We can use the function copyFile() from Magento\Framework\Filesystem;
public function __construct(
$this->mediaDirectory = $filesystem->getDirectoryWrite(DirectoryList::MEDIA);
$result = $this->mediaDirectory->copyFile(
The 'roles' are specific attributes: image (for Base role), small_image (for Small), swatch_image (for Swatch) and thumbnail.
You can find the IDs of these attributes by checking the eav_attribute table and according to their backend_type, you will find the values associated per product in the catalog_product_entity_varchar table. The records will look like ...