Convert SFDX Source to MDAPI Source
In this exercise, you will…
- Use force:source:convertto convert SFDX source to MDAPI source
- Make sure that package.xmlhas the correctfullNamekey defined
Use force:source:convert to convert SFDX source to MDAPI source
Now we’re converting our source back to the MDAPI format from the SFDX format.
Execute this command:
sfdx force:source:convert \
    -d mdapi-source/updated-package \
    -n "My Managed Package"
| Salesforce DX Command / Flags | Description | 
|---|---|
| force:source:convert | Converts source-formatted files into metadata that you can deploy using Metadata API. | 
| -d (--outputdir) | The output directory to store the Metadata API–formatted metadata files in. | 
| -n (--packagename) | The name of the package to associate with the metadata-formatted files. | 
After executing the above, your terminal should look something like this:
 
  
    Make sure that package.xml has the correct fullName key defined
- Open the mdapi-source/updated-packagefolder in the VS Code Explorer.
- Click on the package.xmlfile.
- Observe the value you specified for the -n (--packagename)flag
- See how it gets placed in the package.xmlfile in thefullNamekey.
