Newer Version Available

This content describes an older version of this product. View Latest

Convert the Metadata API Source

After you retrieve the source from your org, you can complete the configuration of your project and convert the source to Salesforce DX project format.

The convert command ignores all files that start with a “dot,” such as .DS_Store. To exclude more files from the convert process, add a .forceignore file.

  1. To indicate which package directory is the default, update the sfdx-project.json file.
  2. Convert the metadata API source to Salesforce DX project format.
    1sfdx force:mdapi:convert --rootdir <retrieve dir name>

    The --rootdir parameter is the name of the directory that contains the metadata source, that is, one of the package directories or subdirectories defined in the sfdx-project.json file.

    If you don’t indicate an output directory with the --outputdir parameter, the converted source is stored in the default package directory indicated in the sfdx-project.json file. If the output directory is located outside of the project, you can indicate its location using an absolute path.

Next steps:

  • Authorize the Dev Hub org and set it as the default
  • Configure the Salesforce DX project
  • Create a scratch org