The code below works for me. It is very fast to run and will not suffer from any third-party module getting in the way of updating your image field either for the fact only the attribute is saved rather than the whole product model.
Instead of filtering by skus like I do below in my script, you can filter the collection in many ways. You may try it first with a sku (like below) and then on the full collection or by set of 1000 products.. good luck
<?php
$path = __DIR__ . '/../';
$shell = 'shell/abstract.php';
$i = 0;
while (! file_exists($path . $shell) && ! file_exists($path . 'htdocs/' . $shell) && $i++ < 15) {
$path .= '../';
}
chdir(file_exists($path . $shell) ? $path : $path . 'htdocs');
require_once $shell;
class Image_Repair_Test extends Mage_Shell_Abstract
{
public function run()
{
$skus = [122663];
$collection = Mage::getModel('catalog/product')->getCollection()
->addAttributeToFilter('sku', $skus)
->addAttributeToSelect('thumbnail')
->addAttributeToSelect('image');
//$collection->setPageSize($limit);
//$collection->setCurPage($page);
if ($collection->count() > 0) {
foreach ($collection as $product) {
$image = $product->getImage();
$thumbnail = $product->getThumbnail();
if (($image == 'no_selection') and !is_null($thumbnail) and (trim($thumbnail) != '')) {
$product->setImage($thumbnail)->getResource()->saveAttribute($product, 'image');
}
}
}
}
}
$shell = new Image_Repair_Test();
$shell->run();