web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Copilot Studio / Copilot Studio - Impor...
Copilot Studio
Suggested Answer

Copilot Studio - Import errors

(1) ShareShare
ReportReport
Posted on by 35


Ive tried to import 2 agents from Developer enviroments and developer to Production and the errors appears:

1. No se ha importado la solución "PromoBot": Sql error: Statement conflicted with a constraint. The INSERT statement conflicted with the FOREIGN KEY constraint "dvtablesearchentity_unstructuredfilesearchentity_unstructuredfilesearchentityId". The conflict occurred in database "db_crmcoresam_20250401_04280863_af82", table "dbo.unstructuredfilesearchentityBaseIds", column 'unstructuredfilesearchentityId'. The statement has been terminated. CRM ErrorCode: -2147185375 Sql ErrorCode: -2146232060 Sql Number: 547

Second Agent:
2.
No se ha importado la solución "UserBook_Oficial": ImportAsHolding failed with exception :Cannot insert duplicate key exception when executing non-query: System.Data.SqlClient.SqlCommand Exception: System.Data.SqlClient.SqlException (0x80131904): Cannot insert duplicate key row in object 'dbo.unstructuredfilesearchentityBase' with unique index 'ndx_for_entitykey_AlternateKeyUnstructuredFileSearchEntity'. The duplicate key value is (4, %252fShared%2bDocuments%252fInformaci%25c3%25b3n%2bp%25c3%25bablica%2b(todo%2bPac%25c3%25adfico)%252fUser%2bPersona%252fUser%2bPersona_Vera_2025.pdf, User Persona_Vera_2025.pdf, 0, Jan 1 1900 12:00AM). The statement has been terminated. at Microsoft.Crm.CrmDbConnection.HandleExecutionException(Exception exception, String commandText, IDbConnection connection, IDbCommand command, IDbTransaction transaction, Boolean isOpen, Int32 commandTimeout, IConnectionRetryPolicy localRetryPolicy, Int32& retryCount) at Microsoft.Crm.CrmDbConnection.InternalExecuteWithRetry[TResult,TArg](Func`2 executeMethod, IDbCommand command, TArg arg, IConnectionRetryPolicy retryPolicy) at Microsoft.Crm.CrmDbConnection.InternalExecuteWithRetry[TResult](Func`1 executeMethod, IDbCommand command, IConnectionRetryPolicy retryPolicy) at Microsoft.Crm.CrmDbConnection.<>c__238`1.<InternalExecuteNonQuery>b__238_0(ValueTuple`8 args) at Microsoft.Xrm.Telemetry.XrmTelemetryExtensions.Execute[T,TArg](ILogger logger, XrmTelemetryActivityType activityType, Func`2 func, TArg arg) at Microsoft.Crm.CrmDbConnection.InternalExecuteNonQuery[TArg](IDbCommand command, Action`1 actionForLoggingAdditionalCustomDimensions, TArg arg, ICrmTransaction crmTransaction, IConnectionRetryPolicy retryPolicy, Int32 sourceLineNumber, String memberName, String sourceFilePath) at Microsoft.Crm.CrmDbConnection.ExecuteNonQueryInTransactionAbstract(IDbCommand command, ICrmTransaction crmTransaction, Int32 sourceLineNumber, String memberName, String sourceFilePath) at Microsoft.Crm.Platform.Server.DataEngine.SqlDataAccessManager.ExecuteNonQuery(IDbCommand command, ISqlExecutionContext context, Int32 sourceLineNumber, String memberName, String sourceFilePath) at Microsoft.Crm.BusinessEntities.BusinessProcessObject.ExecuteNonQueryAbstract(IDbCommand command, ISqlExecutionContext context) at Microsoft.Crm.BusinessEntities.BusinessProcessObject.ExecuteNonQueryAbstract(IDbCommand command, ExecutionContext context) at Microsoft.Crm.Platform.SolutionAwareComponents.CreateInstanceActionBase.ExecuteCreate(IDbCommand command, ExecutionContext context) ClientConnectionId:7263fe21-ad9c-41cb-85f0-e4bf98978ac1 Error Number:2601,State:1,Class:14 ClientConnectionId before routing:8f1c13a5-0244-40ac-aa36-e8c6d4ca3652 Routing Destination:fde21976b3a5.tr1496.brazilsouth1-a.worker.database.windows.net,11060

I can not find the solution in any place and i dont know what else to do.
Categories:
I have the same question (0)
  • Sam_Fawzi Profile Picture
    917 Super User 2026 Season 1 on at
     
    Quick questions (so I can give you the exact safest steps)
    • Are you importing Managed solutions into PROD , or unmanaged?
    • Are you using Pipelines / ā€œStage for upgradeā€ (that’s what triggers ImportAsHolding)?
    • Do these agents include SharePoint/Files knowledge sources?
    Cheers,
  • Suggested answer
    Valantis Profile Picture
    6,735 on at
     

    Your import is failing because SharePoint/OneDrive knowledge sources from your agents already exist in the target environment. Dataverse enforces uniqueness with indexes, causing the duplicate key error.

    Try to Import into a clean environment, or delete the conflicting knowledge sources (same SharePoint paths) from the target environment first.

    Use "Add required objects" in your solution before exporting to include all dependencies.

    If you still get SQL 547 foreign key errors, the best to do is to open a Microsoft support case with the import log.

     

    check also here:


    • Knowledge sources: https://learn.microsoft.com/en-us/microsoft-copilot-studio/knowledge-unstructured-data

    • Import/export: https://learn.microsoft.com/en-us/microsoft-copilot-studio/authoring-solutions-import-export


    •  
     
    • Let me know if that worked out for you.
  • Valantis Profile Picture
    6,735 on at
     

    If you still need any help, feel free to let me know.

    Also, if the issue is resolved, it would be great if you could mark the answer as solved so others with the same question can find it easily.

    Thanks and have a great day!

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Copilot Studio

#1
Valantis Profile Picture

Valantis 277

#2
11manish Profile Picture

11manish 206

#3
sannavajjala87 Profile Picture

sannavajjala87 156 Super User 2026 Season 1

Last 30 days Overall leaderboard