I'm trying to export records from an object that holds 20k records, and I'm using the sfdx force:data:tree:export command but it returns a max of 10k records.

How do I export the remaining records, and append it to my existing JSON file?

Command: sfdx force:data:tree:export -q "QUERY" -d data/t1-afr/ -p --loglevel fatal

1 Answer 1


I was able to extract all records using the soql:query command instead and output to csv.

E.g. sfdx force:data:soql:query -q "QUERY" -r csv > data/filename.csv

  • also works for json sfdx force:data:soql:query -q "QUERY" -r json > data/filename.json
    – Denis P.
    Commented Feb 7 at 17:18

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .