I've created my SFDX project in my IDE (VSCode), pulled my app code from my dev org where I created it before using SFDX, pushed it to my Git repo, cloned a branch into my local repo, created a scratch org (Enterprise) and pushed my source to the scratch org. (Big thanks for this blog from Christophe Coenraets.)

Now, I need to pull data from my original dev org, including the standard Contacts, Leads, Accounts, Opportunities, Cases that are pre-populated in Dev Orgs, as well as sample data in about 8 custom objects.

I'm looking at the SFDX Dev Docs on Export/Import Data Between Orgs, and I have some questions.

  1. Isn't there some kind of bulk command, rather than specifying every field in every object you need in a SOQL query?
  2. Do I have to create nested SOQL queries of multiple objects to maintain master-detail and lookup relationships?
  3. My dev org has a namespace -- not the one I intend to package the app with. (I know... I'm learning.) I've managed all of that in my APEX and Lightning code (without hardcoding), but a SOQL query has to include the namespace prefix for the custom objects/fields. Will that old namespace prefix port to the scratch org (don't want it to.) Thankfully, when I pulled the source from the dev org, the namespace is not on my custom objects.

Any suggestions are greatly appreciated!

  • I've found the force:data:bulk command, but only a brief paragraph here. developer.salesforce.com/docs/atlas.en-us.sfdx_dev.meta/… Looking for more docs now... – PatMcClellan__c Mar 3 '18 at 23:13
  • Found a good workaround for the namespace situation. I do have to use the namespace in the SOQL query to pull the data into DX, but I can open the json data file in the editor and do a quick Find/Replace to extract all the namespace prefixes, then save it as a newly named data file sans namespace prefix -- same with the -plan file. – PatMcClellan__c Mar 4 '18 at 0:52
  • did find any answers for above? – Rajendra Singh Nagar Jul 25 '18 at 4:19
  • @RajendraSinghNagar -- see my workaround above. I didn't find any better solution. – PatMcClellan__c Jul 25 '18 at 17:21

Your Answer

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

Browse other questions tagged or ask your own question.