What i have done in the past in such situations:
1. Build a php-script and let it walk through the links.
or
2. Download all the pictures; use a batch resizer and do all the thumbnails new and upload them again.
I had both situations, depending on the situation.
At the moment i use a php-script to take files from the server, resize them, do the update to the links and move the file to the destination made by the links_files.id, if i remember right.
Code:
$query3 = "INSERT INTO bLinks_Files (ID, ForeignColName, ForeignColKey, File_Name, File_Directory, File_MimeType, File_Size, File_URL) VALUES
(NULL, 'b1', '$lid', '$fn', '/var/www/***/htdocs/***', '$imageMime', '$fileSize', '');
";
$result3 = $linkIS->prepare($query3);
$result3->execute();
$lastLid = $linkIS->lastInsertId();
and
Code:
$fn = "x.jpg";
$query32 = "
UPDATE bLinks_Files SET File_Name = '$fn' WHERE ID = '$lastLid';
UPDATE bLinks SET b1 = '$fn' WHERE bLinks.ID = '$lid';
";
$result32 = $linkIS->prepare($query32);
$result32->execute();
// last digit from lastLid
$dir = substr($lastLid,-1);
$finalfile = "/var/www/***/htdocs/***/" . $dir . "/" . $lastLid . "-" . $fn;
$i->writeImage($finalfile);