function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Mike AgresMike Agres 

ERROR running force:mdapi:convert: Unexpected arguments: --rootdir, mdapi_project, --outputdir, tmp_convert

In an effort to convert some metadata source to the appropriate Source format to apply to a scratch org, I ran this command within my project directory:

sfdx force:mdapi:convert --rootdir mdapi_project --outputdir tmp_convert

in which '--rootdir' and '--outputdir' are specific folder locations within the same project directory.

My result is this error:

ERROR running force:mdapi:convert:  Unexpected arguments: --rootdir, mdapi_project, --outputdir, tmp_convert

Why does this happen? And how to resolve?

Raj VakatiRaj Vakati
In order to convert a MDAPI project into an SFDX Project you MUST run the command from within the SFDX Project Directory

try like this

sfdx force:mdapi:convert -r path/to/metadata -d path/to/outputdir

Refer this link