You could just restore the attachment and filedata tables to a temporary db, run the query to fix the filedata. Run insert ignore queries on the live database using the content of the temp db tables as the source to restore the lost filedata and attachment data. Once that's done merge a restored copy of the attachment folder with the live copy of the attachment folder.
Take a backup before attempting any of this.
|