SharePoint CSOM copy job created never complete

Ivan Tioh 116 Reputation points
2023-05-03T09:17:06.62+00:00

We found this issue starting around few weeks ago.

We create copy job using Microsoft.SharePoint.Client.Site.CreateCopyJobs, with the following CopyMigrationOptions:

  • AllowSchemaMismatch: true
  • IsMoveMode: true or false can replicate the issue
  • NameConflictBehavior: MigrationNameConflictBehavior.Replace
  • IgnoreVersionHistory: true

For reference, we have 1 copy job created at 5/2/2023, 1:07 PM (UTC+8), but has not complete even until now.

This issue is persistent and can be replicated. However, if the file does not yet exist in the destination, there's no problem at all.

Appreciate any pointers/ advices on this.

Thank you!

Microsoft 365 and Office | SharePoint | For business | Windows
0 comments No comments
{count} votes

Accepted answer
  1. RaytheonXie_MSFT 40,476 Reputation points Microsoft External Staff
    2023-05-04T07:31:13.47+00:00

    Hi @

    I have tested the following code and works in SharePoint 2019. Please make a reference

        private SPCopyMigrationInfo CreateCopyJobInternal(Uri[] exportObjectUris, Uri destinationUri, SPCopyMigrationOptions options, Guid correlationId, bool? runOnFE, long totalBytes = 0L)
        {
            throw new InvalidOperationException();
        }
    
        [Obsolete("Use CreateCopyJobs instead")]
        [ClientCallableMethod]
        public SPCopyMigrationInfo CreateCopyJob(Uri[] exportObjectUris, Uri destinationUri, SPCopyMigrationOptions options)
        {
            throw new InvalidOperationException();
        }
    
        [ClientCallableMethod]
        public List<SPCopyMigrationInfo> CreateCopyJobs(Uri[] exportObjectUris, Uri destinationUri, SPCopyMigrationOptions options)
        {
            throw new InvalidOperationException();
        }
    
    

    Or you can provide us with your codes for further testing


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.