Fix issue 1966: Avoid inserting duplicate archive records with record versioning