1

I need to migrate Custom Metadata type using a package.xml.

Can someone please let me know what should I put to get the metadata along with data successfully get migrated? Suppose Custom Metadata type name is Call_Duration_Zip_abv__mdt.

2
  • Why not use Change set for this.This is one of the best feature of suing Custom metadata type
    – Samir
    Apr 27, 2017 at 6:04
  • No our client deliberately needs package . xml :( Apr 27, 2017 at 6:11

1 Answer 1

5

From the Document

A custom metadata type is defined as a custom object and is stored in the objects folder. Custom metadata types have a suffix of __mdt (instead of __c for custom objects). Custom metadata type field names have a suffix of __c, like other custom fields. Custom metadata type field names must be dot-qualified with the name of the custom metadata type to which they belong.

This excerpt from a package.xml file shows the use of dot notation and the __mdt suffix. If you’re using a namespace, for example picklist1234,​ the full name of ReusablePicklistOption__mdt would be picklist1234__ReusablePicklistOption__mdt.

<?xml version="1.0" encoding="UTF-8"?>
<Package xmlns="http://soap.sforce.com/2006/04/metadata">
...
   <types>
      <members>PicklistTest__c.PicklistTestField__c</members>
      <members>ReusablePicklistOption__mdt.Picklist__c</members>
      <members>ReusablePicklistOption__mdt.SortOrder__c</members>
      <members>PicklistUsage__mdt.Field__c</members>
      <members>PicklistUsage__mdt.Picklist__c</members>
      <members>PicklistUsage__mdt.SObjectType__c</members>
      <members>ReusablePicklist__mdt.AlphaSort__c</members>
      <name>CustomField</name>
   </types>
...
   <types>
      <members>PicklistTest__c</members>
      <members>ReusablePicklistOption__mdt</members>
      <members>PicklistUsage__mdt</members>
      <members>ReusablePicklist__mdt</members>
      <name>CustomObject</name>
   </types>
...
   <version>39.0</version>
</Package>

Go through this if you need more information. Let us know if this works for you or not.

1
  • 1
    Gotta love the Metadata API docs. That's always my first step when I need to figure out how to deploy something new via ANT.
    – Derek F
    Apr 27, 2017 at 12:52

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .