Skip to content

Unable to convert single metadata file with sfdx force:mdapi:convert #919

@AllanOricil

Description

@AllanOricil

Summary

After extracting some duplicate rules with mdapi command I needed to convert only one to source format. I tried to do it in several ways as you can see below. At first, I thought the problem was the destination folder, but after converting the whole duplicateRules folder, and using the same destination folder, the conversion worked. So I concluded that the cli does not work with file paths, only with folder paths.

image

If this is working as designed, I would like to convert it to a feature, as this is a command that Im often using. The reason I did not extracted using the source command was because I did not know the metadata name. So I had to extract using the mdapi command passing package.xml for duplicateRules and using *.

Steps To Reproduce:

Extract any metadata type

Run sfdx force:mdapi:convert -r PATH_TO_METADATA_FILE

Verify you can't convert the file

Run sfdx force:mdapi:convert -r PATH_TO_METADATA_TYPE_FOLDER

Verify you can convert the folder but not a single file

Expected result

The command should convert single files

Actual result

The command only converts files if the input is a folder

Additional information

image

Metadata

Metadata

Assignees

No one assigned

    Labels

    investigatingWe're actively investigating this issue

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions