Function migrateUndo