Migration: Fix timeperiod object name stripping.

Fixes #5230