Project migration fails while inserting into AO_6FF49D_MIGRATED_FILE table

Still need help?

The Atlassian Community is here for you.

Ask the community

Platform notice: Server and Data Center only. This article only applies to Atlassian products on the Server and Data Center platforms.

Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.

*Except Fisheye and Crucible

Summary

Learn what to do when your migration fails with the error Caught BatchUpdateException for insert into "public"."AO_6FF49D_MIGRATED_FILE".

Overview

When migrating projects from your Jira On-premise to the cloud with the Jira Cloud Migration Assistant (JCMA), the projects can fail with the above error message.

The signature below can also be seen in the application log file atlassian-jira.log.

ERROR	[c.a.j.m.tracking.polling.Poller] xxx-jiraProjectUpload#8xxx: task worker xxx failed to process Task(migrationId=xxx, migrationTask=com.atlassian.jira.migration.orchestratorclient.tasks.ProjectTransferMigrationTask@7xxx[projectId=10000,heartbeatUrl=https://api-private.atlassian.com/migrations/v1/migration/xxx], cloudSite=AO_6FF49D_CLOUD_SITE {CLOUD_ID = })
com.querydsl.core.QueryException: Caught BatchUpdateException for insert into "public"."AO_6FF49D_MIGRATED_FILE" ("FILE_SERVER_ID", "FILE_MEDIA_ID", "MEDIA_CLIENT_ID", "MIGRATED") values (?, ?, ?, ?)
    at com.querydsl.sql.support.JavaSE7SQLExceptionWrapper.wrap(JavaSE7SQLExceptionWrapper.java:41)
    at com.querydsl.sql.DefaultSQLExceptionTranslator.translate(DefaultSQLExceptionTranslator.java:48)
    at com.querydsl.sql.Configuration.translate(Configuration.java:459)
	...
 	Suppressed: org.postgresql.util.PSQLException: ERROR: duplicate key value violates unique constraint ""
  	Detail: Key ("ID")=(1) already exists.

Duplicate key values in the table AO_6FF49D_MIGRATED_FILE_pkey are a typical result of the previous migration data conflicting with the current migration.

When this happens, it is recommended that a clean start is made by reinstalling the JCMA on the source site.

Solution

Only apply this solution if you are in the Test Migration phase and the destination cloud instance is a staging or sandbox environment.

  1. Uninstall the app:
    1. Navigate to Apps > Manage apps.
    2. Spot the JCMA app in the list.
    3. Click Uninstall.
    4. A notice appears indicating that the app was successfully uninstalled.
  2. Stop the Jira On-Premise instance (Start and Stop Jira applications).
  3. Back up your database.
  4. Run the following commands on your Jira On-Premise database to obtain new commands:

    SELECT CONCAT('DROP TABLE "', table_name, '";') FROM information_schema.tables WHERE table_name LIKE 'AO_6FF49D_%';
    SELECT CONCAT('DROP TABLE "', table_name, '";') FROM information_schema.tables WHERE table_name LIKE 'AO_6FF49D_%';
    SELECT CONCAT('DROP TABLE "', table_name, '";') FROM information_schema.tables WHERE table_name LIKE 'AO_6FF49D_%';
    SELECT CONCAT(CONCAT('DROP TABLE ', table_name), ';') FROM USER_TABLES WHERE TABLE_NAME LIKE 'AO_6FF49D_%';
  5. Run the commands resulting from the previous step to drop the JCMA tables.
  6. Start your Jira On-Premise instance (Start and Stop Jira applications).
  7. Reinstall the JCMA app (Install the Jira Cloud Migration Assistant).
  8. Retry the migration.
Last modified on Mar 21, 2024

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.