Fix command name with special chars not being migrated.

Fixes #5234