Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Power Apps Pro Dev & ISV
Unanswered

Power Platform CLI data export - Failed to create output file

(0) ShareShare
ReportReport
Posted on by 8

Hi, 

I am trying to do an export and import of data between environments.
I used the CMT (DataUtilityTool.exe/CRM Configuration Migration Tool) to make a schemafile,

and I used the "pac data export" command to retrieve the data, but after running for a long time (14:30h ish) and finishing exporting all records, it fails, giving me "datastream is to long" when trying to write to file (highlighted line in picture, it's norwegian):

bilde.png

 

Maybe I'm abusing the tool with exporting too much, but I tought this was an unexpected error because it is finished exporting all data from the database? 

  • RiadMokhtari Profile Picture
    7 on at
    Re: Power Platform CLI data export - Failed to create output file

    Hello,

     

    I got this error message with Migration Data Utility 
    someone has encounter this ? 

    DataMigrationUtility.Export Information 8 27/02/2024 10:52:16 Found 374863 rows for comp_prix entity
    DataMigrationUtility.Export Information 8 27/02/2024 10:52:16 Processing Prix rows for 374863 to export stream
    DataMigrationUtility.Export Information 8 27/02/2024 10:52:42 Exporting of files is disabled. Skipping
    DataMigrationUtility.Export Information 8 27/02/2024 10:52:42 Entity Export Process Complete
    DataMigrationUtility.Export Information 8 27/02/2024 10:52:42 Writting output file : C:\WINDOWS\TEMP\5afszgz3.oms\data.xml
    DataMigrationUtility.Export Error 2 27/02/2024 10:53:36 Message: Exception Raised when Serializing Microsoft.Xrm.Tooling.Dmt.DataMigCommon.DataModel.Data.entities
    Source : mscorlib
    Method : CreateStringFromEncoding
    Date : 27/02/2024
    Time : 10:53:36
    Error : Une exception de type 'System.OutOfMemoryException' a été levée.
    Stack Trace : à System.String.CreateStringFromEncoding(Byte* bytes, Int32 byteLength, Encoding encoding)
    à System.Text.UTF8Encoding.GetString(Byte[] bytes, Int32 index, Int32 count)
    à Microsoft.Xrm.Tooling.Dmt.DataMigCommon.Utility.Helper.Serialize[T](Object objToSerialize)
    ======================================================================================================================

    DataMigrationUtility.Export Error 2 27/02/2024 10:53:36 Failed to create output file
    DataMigrationUtility.Export Information 8 27/02/2024 10:53:36 *********************************************************
    DataMigrationUtility.Export Information 8 27/02/2024 10:53:36 Error : No Valid Data Found to export
    DataMigrationUtility.Export Information 8 27/02/2024 10:53:36 *********************************************************
    DataMigrationUtility.Export Information 8 27/02/2024 10:53:36 ** EXIT EXPORT PROCESS FAIL **
    DataMigrationUtility.Export Information 8 27/02/2024 10:53:36 *********************************************************

  • MariusW Profile Picture
    8 on at
    Re: Power Platform CLI data export - Failed to create output file

    Here is the command I used:

    pac data export -sf .\allCustomComponents.xml -df data.zip -env **** -v

    I was running it using a powershell terminal in VS Code and the power platform tool extension.
    And I have trusted the folders I'm working in, in VSC. If that helps? 

    I will try using the full path from root for -sf and -df and using the external powershell as admin.

  • cchannon Profile Picture
    4,702 Super User 2025 Season 1 on at
    Re: Power Platform CLI data export - Failed to create output file

    Try running the cmd prompt (or pshell) as Admin - the folder you're trying to write to might be permission trimmed.

     

    If that doesn't work, make sure you're providing a valid path for the destination file. Remember that the -df parameter expects you to provide the full path to the zip to write, including its filename and extension.

  • MariusW Profile Picture
    8 on at
    Re: Power Platform CLI data export - Failed to create output file

    Checked it now, and there was no other usefull information, i included the "--verbose" flag in my command as well. it seams like the entity export process was successful but it cant write it to file.

    log.png

  • cchannon Profile Picture
    4,702 Super User 2025 Season 1 on at
    Re: Power Platform CLI data export - Failed to create output file

    Your assumption sounds like the same one I'd make. Have you checked the log file to see if there is more useful error messaging there?

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

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Warren Belz – Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Community…

Leaderboard > Power Apps - Power Apps Pro Dev & ISV

#1
WarrenBelz Profile Picture

WarrenBelz 109 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 76 Super User 2025 Season 1

#3
mmbr1606 Profile Picture

mmbr1606 71 Super User 2025 Season 1

Overall leaderboard