Fix serialize migration. Fixes #7734