I try to migrate my sharepoint library from on-premise SharePoint 2013 to SharePoint online. I do this by folowing SharePoint Online deployment advisor instructions.

I did this successfully:

Export-SPWeb -Identity http://contosoweb/sites/project01 -Path C:\migration\Project01Library -ItemUrl "Shared Documents" -NoFileCompression

I created an user mapping CSV file. It looks like:


After that I defined variables and tried to do this:

$finalPackages = ConvertTo-SPOMigrationTargetedPackage -ParallelImport -SourceFilesPath $sourceFiles -SourcePackagePath $sourcePackage -OutputPackagePath $targetPackage -Credentials $cred -TargetWebUrl $targetWeb -NoAzureADLookup -TargetDocumentLibraryPath $targetDocLib  -UserMappingFile $userMapFile 

But I got an error:

ConvertTo-SPOMigrationTargetedPackage : Object reference not set to an
instance of an object.
At line:1 char:18
+ $finalPackages = ConvertTo-SPOMigrationTargetedPackage -ParallelImport
-SourceFi ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [ConvertTo-SPOMigrationTargete
   dPackage], NullReferenceException
    + FullyQualifiedErrorId : System.NullReferenceException,Microsoft.Online.S

How to fix it? I have diferent domain in SharePoint online and on-premise SharePoint. Should be usernames in the mapping csv file from on-premise SharePoint or SharePoint online domain (well, the error is the same)?


If you want to migrate sharepoint library from on-premise SharePoint 2013 to SharePoint online, you can refer to this article.

About this error, you can check if it has any detail error message in the ULS log.

You can refer to the same issue in this article.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.