# Deploying reference data: custom metadata and upserts

*Platform Development Lifecycle and Deployment Architect Study Guide · Deploying · Last updated October 26, 2026 · https://www.certifyforce.com/study-guide/platform-development-lifecycle-and-deployment-architect/deploying/deploying-reference-data-custom-metadata-and-upserts*

When configuration belongs in custom metadata records that deploy with the release, how to move and generate those records, their allocation, locks and package protection, and how to load reference data kept in custom objects with external IDs, tree imports and bulk upserts.

- Certification: Salesforce Platform Development Lifecycle and Deployment Architect
- Exam section: Deploying
- Study guide: https://www.certifyforce.com/study-guide/platform-development-lifecycle-and-deployment-architect

**Official exam objective:**

> Given a scenario, describe and recommend an approach to manage and deploy technical reference data - configuration stored as object data.

## What the exam expects

- Recommend custom metadata records, a custom setting or a custom object for technical reference data, from volume, hierarchy needs and how the data must deploy.
- Move custom metadata records with change sets and manifests, and generate them with the `sf cmdt` commands.
- Predict deploy-time behaviour: omitted values, `xsi:nil`, record locks and the character allocation.
- Load object-based reference data repeatably with external IDs, relationship columns, tree imports and bulk upserts.
- Explain protected versus public custom metadata in managed packages.

Key terms: **technical reference data** (configuration stored as records, such as mappings or rates), **custom metadata record** (a record whose values are metadata, so it deploys), **external ID** (an indexed custom field that identifies a record across orgs), **upsert** (insert if missing, update if present), **plan file** (a CLI file that orders sObject tree files for import), **protected type** (a packaged type subscribers can't add records to).

## Key facts

| Fact | Detail | Source |
|---|---|---|
| Custom setting records | Can't be deployed by package, Metadata API or change set | [Understanding Custom Metadata Types](https://trailhead.salesforce.com/content/learn/modules/custom_metadata_types_dec/cmt_overview) |
| Type in a change set | Its records aren't included automatically | [Custom Metadata Types in Change Sets](https://help.salesforce.com/s/articleView?language=en_US&id=platform.custommetadatatypes_changesets.htm&type=5) |
| Record member name | Type name without `__mdt`, a dot, record name | [CustomMetadata](https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/meta_custommetadata.htm) |
| `fromorg` and hierarchy settings | Not supported | [Create and Manage Custom Metadata Types Using CLI Commands](https://help.salesforce.com/s/articleView?id=platform.custommetadatatypes_cli.htm&language=en_US&type=5) |
| Allocation | 10 million characters per org, by maximum field size | [Custom Metadata Allocations and Usage Calculations](https://help.salesforce.com/s/articleView?id=platform.custommetadatatypes_limits.htm&language=en_US&type=5) |
| Records per transaction | 50,000 | [Custom Metadata Allocations and Usage Calculations](https://help.salesforce.com/s/articleView?id=platform.custommetadatatypes_limits.htm&language=en_US&type=5) |
| Relationship header depth | Child to parent only; no grandparent | [Relationship Fields in a Header Row](https://developer.salesforce.com/docs/atlas.en-us.api_asynch.meta/api_asynch/datafiles_csv_rel_field_header_row.htm) |
| Tree export query | Maximum 2,000 records | [data export tree](https://developer.salesforce.com/docs/platform/salesforce-cli-reference/guide/cli_reference_data_export_tree.html) |
| Tree import file | 200 records with `--files`; more with `--plan` | [data import tree](https://developer.salesforce.com/docs/platform/salesforce-cli-reference/guide/cli_reference_data_import_tree.html) |

## Check yourself

- Why does a Text Area field on a custom metadata type use the allocation faster than a 10-character Text field?
- When must files in a tree import plan be ordered?
- Which parent fields can a relationship column in a bulk CSV header use?
- Why should a package developer pick protected record developer names carefully?

## Sources

- [Understanding Custom Metadata Types](https://trailhead.salesforce.com/content/learn/modules/custom_metadata_types_dec/cmt_overview)
- [Custom Metadata Types](https://help.salesforce.com/s/articleView?id=sf.custommetadatatypes_overview.htm&type=5&language=en_US)
- [Deploy Custom Metadata Types and Records to Production Orgs Using Change Sets](https://help.salesforce.com/s/articleView?language=en_US&id=platform.custommetadatatypes_changesets.htm&type=5)
- [CustomMetadata](https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/meta_custommetadata.htm)
- [Create and Manage Custom Metadata Types Using CLI Commands](https://help.salesforce.com/s/articleView?id=platform.custommetadatatypes_cli.htm&language=en_US&type=5)
- [cmdt generate fromorg](https://developer.salesforce.com/docs/platform/salesforce-cli-reference/guide/cli_reference_cmdt_generate_fromorg.html)
- [cmdt generate records](https://developer.salesforce.com/docs/platform/salesforce-cli-reference/guide/cli_reference_cmdt_generate_records.html)
- [Custom Metadata Types Limitations](https://help.salesforce.com/s/articleView?id=platform.custommetadatatypes_limitations.htm&language=en_US&type=5)
- [Custom Metadata Allocations and Usage Calculations](https://help.salesforce.com/s/articleView?id=platform.custommetadatatypes_limits.htm&language=en_US&type=5)
- [Relationship Fields in a Header Row](https://developer.salesforce.com/docs/atlas.en-us.api_asynch.meta/api_asynch/datafiles_csv_rel_field_header_row.htm)
- [data upsert bulk](https://developer.salesforce.com/docs/platform/salesforce-cli-reference/guide/cli_reference_data_upsert_bulk.html)
- [data import tree](https://developer.salesforce.com/docs/platform/salesforce-cli-reference/guide/cli_reference_data_import_tree.html)
- [data export tree](https://developer.salesforce.com/docs/platform/salesforce-cli-reference/guide/cli_reference_data_export_tree.html)

## About the full unit

The "Core concepts", "Exam traps" and "Worked scenario" sections of this unit, its 14 linked practice questions, and unlimited timed mock exams are included with the Platform Development Lifecycle and Deployment Architect pack (USD $19): https://www.certifyforce.com/practice-exams
