Convert MDAPI Source to SFDX Source

In this exercise, you will…

  • Use the CLI to convert MDAPI source to SFDX source

Use the CLI to convert MDAPI source to SFDX source

Salesforce DX uses source code that is structured somewhat differently than classic Metadata API source. So, for us to use your packaged code with Salesforce DX, we need to convert it to the SFDX Source format.

Execute this command:

sfdx force:mdapi:convert -r mdapi-source/original-package
Salesforce DX Command / Flags Description
force:mdapi:convert Converts metadata retrieved via Metadata API into the source format used in Salesforce DX projects.
-r (--rootdir) The root directory that contains the metadata you retrieved using Metadata API.

After executing the above, your terminal should look something like this:

Updated: