Question / Problem:
Given 2 project backups with same OAuth users containing identical names and bound to same OAuth applications, but different ids. Those Ids are part of project backup. When restoring one backup on top of another this will cause MC to throw an error:
16098879 [ImportManager.import] ERROR com.kapowtech.scheduler.server.export.Importer - Import failed
javax.persistence.PersistenceException: Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.7.0.v20170811-d680af5): org.eclipse.persistence.exceptions.DatabaseException
Internal Exception: java.sql.BatchUpdateException: ORA-00001: unique constraint (SCHEDULER.UNQ_MC_OAUTH_USER_0) violated
Answer / Solution:
This is a Bug: Bug 1469027:[MC] Constraint violation when restoring project with OAuth user
It was reported in 10.6.0.3 and fixed 10.6.0.6, 184.108.40.206, and in 11.1.
Remove individual OAuth users from MC_OAUTH_USER table which conflicts with backup. if you unzip project export file and navigate to project folder, there is the global.xml file where you can find oauth user entities. Find those users with different ids and remove them from database table.
Additionally, you can remove all users and oauth applications which match your project id and then repeat import process.