Okay, I have found the issue, the restore of the database missed the 'auto_increment' field attribute for the templatedetails table, I've audited all other tables and they are fine, it's just this one table that the attribute was missing.
Thanks for you help