If you have existing marketing activity extensions that were created and are managed through the Partner Dashboard, then you should migrate them to Shopify CLI.
## Requirements
- You have [the latest version of Shopify CLI](/docs/apps/build/cli-for-apps/migrate-to-latest-cli).
- Your Partner Dashboard app has been [migrated to CLI](/docs/apps/build/cli-for-apps/migrate-from-dashboard).
## Step 1: Import your Marketing Activity extension locally
1. Navigate to your app's directory.
2. Run the following command:
3. Select Marketing Activity Extensions
as the type of extension to import.
4. Select an extension to import from the list.
After completing the prompts, a TOML file is generated by importing your extension's existing configurations.
## Step 2: Verify your TOML file
Please review your TOML file to ensure the extension is configured properly. The following is an example of a TOML file that was generated for an imported marketing activity extension:
The following table describes the properties in the TOML file that are specific to a Marketing activity extension:
| Property | Description |
|---|---|
| `[extensions]`
Required | Settings related to the template. Contains the following properties:
- `title`Required : The title of the activity.
- `description`Required : The description of the activity.
- `api_path`Required: The API path of the hosted [marketing activity endpoints](/docs/api/marketing-activities/endpoints). This is appended to the app's base URL.
- `tactic`Required : The tactic of the activity. Valid tactics are:
- `ad`
- `abandoned_cart`
- `affiliate`
- `link`
- `loyalty`
- `message`
- `newsletter`
- `notification`
- `post`
- `retargeting`
- `seo`
- `storefront_app`
- `transactional`
- `marketing_channel`Required : The marketing channel of the activity. Valid marketing_channels are:
- `display`
- `email`
- `marketplace`
- `referral`
- `search`
- `sms`
- `social`
- `referring_domain`: The referring domain of which activity traffic is routed to the shop. If the marketing channel is `email` or `sms`, then the referring domain must be omitted.
- `is_automation`: Whether the activity is a marketing automation. Marketing automations are ongoing activities that are triggered by an event or customer action (for example, an abandoned cart email, message, or notification).
|
| `[extension.preview_data.types]` | Types that are used with the [preview endpoint](/docs/api/marketing-activities/endpoints#preview-a-marketing-activity). The defaults are desktop and mobile. |
| `[extensions.fields]`
Required| The fields used to define the marketing activity form tha's displayed to merchants in the Shopify admin. For a complete reference on the available fields, refer to [marketing activities components](/docs/api/marketing-activities/components) |
## Step 3: Migrate your extension
After you've imported the extension, you can migrate your extension by using Shopify CLI's `deploy` command.
> Note:
> Deploying extensions using the `app deploy` command also publishes the extensions. We recommend testing changes by using [`app dev`](/docs/api/shopify-cli/app/app-dev) or deploying to a test app before deploying them to a production app.
Use Shopify CLI to deploy your extensions:
1. Navigate to your app directory.
2. Run the following command to start deploying your extensions:
```bash
#!/bin/bash
shopify app deploy
```
3. Follow the prompts.
When you receive confirmation that the deploy was successful, your extensions have been released.