Skip to content
Open
Show file tree
Hide file tree
Changes from 57 commits
Commits
Show all changes
59 commits
Select commit Hold shift + click to select a range
ae60d10
Fri 2 May initial draft
dcjarvis May 2, 2025
3f908d9
Add .DS_Store to gitignore
dcjarvis May 22, 2025
c6d5bd7
Updated campaign import/export documentation
dcjarvis May 7, 2025
e57b5e2
updates to user docs for campaign export and import
dcjarvis May 9, 2025
fbef5c6
clarify messenger:consume params
O-Mutt Apr 30, 2025
b64cf46
Update cron_jobs.rst
O-Mutt Apr 30, 2025
bfa6d50
Update cron_jobs.rst
O-Mutt Apr 30, 2025
c274d66
Update cron_jobs.rst
O-Mutt Apr 30, 2025
a044ec1
Update cron_jobs.rst
O-Mutt Apr 30, 2025
bdb0fb9
Update docs/configuration/cron_jobs.rst
O-Mutt Apr 30, 2025
7ddbe75
Update docs/configuration/cron_jobs.rst
O-Mutt May 5, 2025
54669dd
updates from prose review
dcjarvis May 20, 2025
b50e7c9
updates from prose review
dcjarvis May 20, 2025
57b6f71
updates from prose review 2
dcjarvis May 20, 2025
1ff47f6
Resolve .gitignore merge conflict
dcjarvis May 22, 2025
0ad90a0
prose review 3
dcjarvis May 20, 2025
1fc3e86
prose review 4
dcjarvis May 20, 2025
ef57099
prose review 5
dcjarvis May 20, 2025
2b81a5f
prose review 6
dcjarvis May 20, 2025
a911777
prose review complete
dcjarvis May 20, 2025
4f4b529
addition of path to export file command line parameter
dcjarvis May 22, 2025
282ad9b
Merge branch '7.0' into campaign-import-export-user-docs
adiati98 Jul 13, 2025
0ee96ce
Merge branch '7.0' into campaign-import-export-user-docs
RCheesley Nov 4, 2025
e29ebd9
Vale fixes
RCheesley Nov 4, 2025
e05328d
RST syntax fixes
RCheesley Nov 4, 2025
ac6fd7b
Fix grammar
RCheesley Nov 4, 2025
f910271
Remove image height restriction
RCheesley Nov 4, 2025
89478c0
Fix spacing in list
RCheesley Nov 4, 2025
51362b5
use example.com in examples.
RCheesley Nov 4, 2025
e19fd30
Update gitignore
RCheesley Nov 4, 2025
a721bde
Merge branch '7.0' into campaign-import-export-user-docs
adiati98 Dec 19, 2025
552f94f
Merge branch '7.0' into campaign-import-export-user-docs
adiati98 Jan 22, 2026
24223d1
Merge branch '7.0' into campaign-import-export-user-docs
adiati98 Jan 25, 2026
c7fc039
fix: unrendered table
adiati98 Jan 25, 2026
6b1464b
adjust wordings and address Vale in exporting_campaigns.rst and comma…
adiati98 Jan 25, 2026
4b99b28
adjust wordings and address vale warnings in importing_campaigns.rst
adiati98 Jan 25, 2026
c015187
adjust wording and structure in exporting_campaigns.rst for consistency
adiati98 Jan 25, 2026
ea8e73a
apply vale off and on statements
adiati98 Jan 25, 2026
a85a892
update instructions to export with mautic instance
adiati98 Jan 25, 2026
c2b1c2d
remove campaigns/images/activate-campaign.png
adiati98 Jan 25, 2026
51a7845
add images
adiati98 Jan 25, 2026
dbebd0e
fix: broken internal links
adiati98 Jan 25, 2026
3316507
fix typo
adiati98 Jan 25, 2026
80c8590
Merge branch '7.0' into campaign-import-export-user-docs
adiati98 Mar 5, 2026
58f0c25
remove campaigns/images/campaign-sample.json
adiati98 Mar 6, 2026
054bbc7
remove custom fields from supported data types
adiati98 Mar 6, 2026
d1a7364
move how the exporting campaigns works section to the bottom
adiati98 Mar 6, 2026
5900ca5
move How the importing Campaign works section to the bottom
adiati98 Mar 6, 2026
ab58d10
Merge branch '7.0' into campaign-import-export-user-docs
RCheesley Apr 1, 2026
0cd6665
Merge branch '7.0' into campaign-import-export-user-docs
adiati98 Apr 5, 2026
b8da6ff
Apply suggestions from code review
adiati98 Apr 21, 2026
b61e638
Apply suggestions from code review
adiati98 May 18, 2026
81337c4
Apply suggestions from code review
adiati98 Jun 5, 2026
3b3e1b1
Apply suggestions from code review
adiati98 Jun 5, 2026
5eed0f8
fix: command examples
adiati98 Jun 12, 2026
4b25e2f
Merge branch '7.0' into campaign-import-export-user-docs
adiati98 Jun 12, 2026
59d34ed
fix: broken python example
adiati98 Jun 24, 2026
0a98f2f
fix: apply the same comment as in the suggestion
adiati98 Jul 28, 2026
f3acd43
Merge branch '7.0' into campaign-import-export-user-docs
adiati98 Jul 29, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -158,4 +158,4 @@ dmypy.json
# Cython debug symbols
cython_debug/

# End of https://www.toptal.com/developers/gitignore/api/python,jupyternotebooks
# End of https://www.toptal.com/developers/gitignore/api/python,jupyternotebooks
155 changes: 155 additions & 0 deletions docs/campaigns/exporting_campaigns.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,155 @@
Exporting Campaigns

Check warning on line 1 in docs/campaigns/exporting_campaigns.rst

View workflow job for this annotation

GitHub Actions / prose

[vale] reported by reviewdog 🐶 [Google.Headings] 'Exporting Campaigns' should use sentence-style capitalization. Raw Output: {"message": "[Google.Headings] 'Exporting Campaigns' should use sentence-style capitalization.", "location": {"path": "docs/campaigns/exporting_campaigns.rst", "range": {"start": {"line": 1, "column": 1}}}, "severity": "WARNING"}
###################

Before importing or exporting data, back up your database as a safety precaution in case you need to restore it. Speak to the administrator of your Mautic instance to do this, as it requires specific technical knowledge.

.. important::

Both the import and export features are available only in Mautic 7.0 and later versions.

Supported data types
********************

When you select a Campaign, the export feature extracts all Campaign data and entities, along with any dependencies the Campaign needs to function, including:

* Dynamic Content
* Asset\*
Comment thread
adiati98 marked this conversation as resolved.
* Other related dependencies

Comment thread
adiati98 marked this conversation as resolved.
.. note::

\* The exported Campaign includes only directly associated Assets.

The export command:

* Detect use of Plugins and Custom Fields
* Include the data to support these dependencies
Comment thread
adiati98 marked this conversation as resolved.

.. important::

The importing instance needs the same Custom Fields and Plugins to be present.
Comment thread
adiati98 marked this conversation as resolved.

.. vale off

Exporting a Campaign
********************

.. vale on

You can export a Campaign in three ways.

1.\ Using Mautic instance
=========================

#. Go to the **Campaigns** menu.
#. Click the three-dot icon next to the Campaign's name that you want to export to open the options.
#. Select the **Export** option from the dropdown menu. It automatically downloads the ZIP file.

|

.. image:: images/export_campaign.png
:alt: Highlight of Campaign menu, Options three-dot button, and Export option in the Mautic Campaigns section

|

.. vale off

2.\ Using the command line
==========================

.. vale on

Use the following commands to save the exported file:

**1. In a specific directory**

.. code-block:: bash

bin/console mautic:entity:export --entity=campaign --id=1 --zip-file --path=path/to-file

**Command parameters**

* ``--entity``: defines the type of entity to export, in this case, ``campaign``.
* ``--id``: defines the ID of the Campaign to export. When you view or edit the Campaign, look at the URL to find the ID. For example, ``/s/campaigns/view/123``, where ``123`` is the ID.
* ``--zip-file``: creates a ZIP file of the Campaign and its dependencies.
* ``--path``: specifies the directory to save the exported file.

**2. In a JSON file**

.. code-block:: bash

bin/console mautic:entity:export --entity=campaign --id=1 --json-only

* Creates only a JSON file and ignores any additional resources.

3.\ Using Mautic API
====================

You can programmatically export Campaigns using the Mautic API. To do this, you must authenticate your API request with the credentials stored in Mautic's settings.

.. vale off

For more details on how to authenticate, see the :doc:`Authentication page </authentication/authentication>`.

Comment thread
adiati98 marked this conversation as resolved.
.. important::

* The API uses a GET request to export a specific Campaign by ID.

* Before running the following cURL or Python examples, ensure you:

* Replace ``example.com`` with the actual Mautic instance domain.
* Replace ``YOUR_ACCESS_TOKEN`` with a valid authentication token.
* Verify that the User account has the necessary API permissions.

.. vale on

cURL example
Comment thread
adiati98 marked this conversation as resolved.
------------

.. code-block:: bash

curl --location 'https://example.com/api/campaigns/export/1' \
--header 'Authorization: Bearer YOUR_ACCESS_TOKEN'

Python example
--------------

.. code-block:: python

import requests

# API Endpoint
campaign_id = 1
url = f'https://example.com/api/campaigns/export/{campaign_id}'

# Authentication
headers = {
'Authorization': 'Bearer YOUR_ACCESS_TOKEN'
}

# Send export request
response = requests.get(url, headers=headers)

# Handle response
if response.status_code == 200:
export_file = response.content
# Save or process the exported campaign

.. vale off

How Campaign export works
*************************

.. vale on

Whether exporting via Mautic instance, the command line, or the API, the process follows these logic steps:

.. vale off

* **Permissions:** verifies that the logged-in User has the correct permissions to export.
* **Bulk export:** supports exporting multiple Campaigns simultaneously.
* **Data structure:** exports data in a structured JSON format to ensure compatibility.
* **Asset management:** exports Assets into a separate folder in their original format.
* **File packaging:** compresses the resulting collection of files into a single ZIP file for easy transfer across systems.

.. vale on
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/campaigns/images/export_campaign.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/campaigns/images/import_campaign.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/campaigns/images/upload_zip_file.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading