Hello,
Unicity constraint violation during a DB migration does indicate a potential problem with the dataset itself.
Either during this upgrade an instance was connected to the database and changing the dataset, or you are working with a dump done in hot backup mode.
Anyway, you need to check that no instance is connected to the db while performing the migration or to get a dump done in cold backup mode.
Greetings,
Alex.