Skip to content

09. Examples

Jörn Berkefeld edited this page Apr 2, 2026 · 2 revisions

Retrieve and deploy Data Extension

  1. Retrieve metadata by running mcdev retrieve <BU> (where the BU corresponds to a credential-Business Unit combo in the .mcdevrc.json)
  2. Create a directory called deploy/ in the root directory
  3. Create a directory called dataExtension/ in the deploy/ directory
  4. Copy a single dataExtension directory from the retrieve/<credential>/<BU-Name>/dataExtension/ directory into deploy/<credential>/<BU-Name>/dataExtension/
  5. Run mcdev deploy <BU> to deploy everything in the deploy folder to the specified Business Unit

Metadata Retrieving/Backup

Metadata of a Business Unit can be retrieved by running the following command:

mcdev retrieve <BU>

where <BU> needs to be replaced with credentialName/businessUnit-Name that is defined in .mcdevrc.json.

Run this command for each of your defined Business Units and this will result in a retrieve directory with a sub-directory for each Business Unit. Each sub-directory contains the metadata from this Business Unit that is currently supported to retrieve.

This folder structure can be committed into a git repository and used as a backup.

Automation Deployment

Now we want to deploy an Automation with its related metadata. Select a retrieved Automation and copy it into the deploy folder. (deploy/<credential>/<BU-Name>/automation/myAutomation.meta-automation.json)

Copy all related activity metadata of this automation into the deploy folder. (Example: deploy/<credential>/<BU-Name>/query/myquery.meta-query.json and deploy/<credential>/<BU-Name>/query/myquery.meta-query.sql)

To start the deployment run the following command:

mcdev deploy <BU>

Clone metadata between Business Units

The clone command provides a quick way to copy metadata from one BU to another:

# Clone a query from DEV to QA
mcdev clone --buFrom MyProject/DEV --buTo MyProject/QA -m query:myQuery

# Clone with all dependencies
mcdev clone --buFrom MyProject/DEV --buTo MyProject/QA -m automation:myAutomation --dependencies

Journey Management

Manage journey lifecycle directly from the CLI:

# Retrieve only published journeys
mcdev retrieve MyProject/DEV journey --onlyPublished

# Pause a running journey
mcdev pause MyProject/DEV journey myJourneyKey

# Stop all versions of a journey
mcdev stop MyProject/DEV journey myJourneyKey/*

# Validate a draft journey
mcdev validate MyProject/DEV journey myJourneyKey

# Deploy and publish in one step
mcdev deploy MyProject/DEV journey --publish

Clone this wiki locally