def _migrate_contributions(self):
        contribs = []
        friendly_id_map = {}
        friendly_ids_used = set()
        skipped = []
        for id_, contrib in sorted(self.old_event.contributions.items(),
                                   key=lambda x: (not x[0].isdigit(), int(x[0]) if x[0].isdigit() else x[0])):
            try:
                id_ = int(id_)  # legacy: s1t2
            except ValueError:
                skipped.append(contrib)
                continue
            if id_ in friendly_ids_used:
                skipped.append(contrib)
                continue
            friendly_id_map[contrib] = id_
            friendly_ids_used.add(id_)
        for i, contrib in enumerate(skipped, (max(friendly_ids_used) if friendly_ids_used else 0) + 1):
            assert i not in friendly_ids_used
            friendly_id_map[contrib] = i
            friendly_ids_used.add(i)
        for old_contrib in self.old_event.contributions.itervalues():
            contribs.append(self._migrate_contribution(old_contrib, friendly_id_map[old_contrib]))
        if contribs:
            self.event._last_friendly_contribution_id = max(c.friendly_id for c in contribs)