script to migrate old repeat records to new db