Fix migration script, refs #6226