4

I am really excited about Salesforce DX and I have playing with it for a while. However, I'm still looking for a way to retrieve all metadata from our client's sandbox in order to convert it to the Salesforce DX new file system structure.

I know that I can create a unmanaged package and retrieve it easily with DX CLI. But my client's org is pretty big with huge amount of metadata, so creating an unmanaged package is going to take me a while, plus I have to keep updating it each time metadata changes. Not a good solution for the long run.

Is there an easy way of getting absolutely all metadata from a sandbox? It's like getting a copy of the sandbox using metadata API or any other tool. I have trying the new command of DX: sfdx force:mdapi:retrieve, but I was not successful for now.

Thanks

9

This is what I would do:

  1. Create a project in Force IDE or Mavensmate connecting to your sandbox and select all the metadata components and retrieve metadata. Trick here is that Force IDE and Mavensmate also creates package.xml

  2. Now use the package.xml created in above step and use the below command as suggested in this answer

    sfdx force:mdapi:retrieve --retrievetargetdir force-app -k package.xml

| improve this answer | |
  • Actually I have thought about this. But the question is, are we sure that Force IDE or Mavensmate are able to retrieve everything? – Riadh Mankai Oct 27 '17 at 23:23
  • 1
    @RiadhMankai Yes, it does depending on the component types you choose while creating project in Mavensmate and Force IDE. – javanoob Oct 27 '17 at 23:24
  • 1
    @RiadhMankai the IDE can retrieve everything that can be deployed via DX. Keep in mind that not all metadata can be deployed, but there are also additional settings you can deploy during scratch org creation. Be sure to check the documentation. – sfdcfox Oct 27 '17 at 23:48
  • 3
    I'm good with these options thanks guys. I also found a web called the Salesforce Toolkit that actually does a good job on getting a package.xml with full metadata of an org. – Riadh Mankai Oct 28 '17 at 13:11
  • 2
    How do you build your package.xml file? Both Mavensmate and Force IDE are not being updated. Force IDE uses a max API version of 38 (so I cannot synchronize lightning components) – Jon Wolski Jun 14 '18 at 16:07
0

I create my package.xml with Salesforce Toolkit - https://packagebuilder.herokuapp.com/ I manually edited the package.xml and used it with salesforce dx. Caution - the toolkit will connect to your org. The author has made the source code available so you can download, scan and run locally.

IntelliJ with JetForcer or IlluminatedCloud are great options as well.

| improve this answer | |
0

This one works for me very well for me

https://www.npmjs.com/package/sfdx-ext

| improve this answer | |

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.