Skip to content

09. Examples

Jörn Berkefeld edited this page Feb 24, 2023 · 1 revision

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>