Fix migration script to rely on attributes only

Also use our new helper function to create occurrences instead of the
legacy splitToPeriods