← Back to Blog
Mautic Migration Marketing Automation

How our developers use AI coding agents to migrate Marketo to Mautic

How our developers use an AI coding agent in a Marketo to Mautic migration: export, mapping, scripted builds, dry runs, review, validation and a clean cutover.

M Mautomic Team
13 min read

Our developers use an AI coding agent in a Marketo to Mautic migration to map the source platform faster and to make every run repeatable. The developer leads. He decides the mapping, reviews every script and approves every run. Below is the full workflow from a recent project with about 95,000 contacts: the setup, the stages, the guardrails and what the client gets out of it.

Why does every migration start with mapping the source platform?

We move clients to Mautic from different platforms: Marketo, HubSpot, Pardot and others. Each one has its own data model, its own API limits and its own names for the same things. A Marketo smart list is a Mautic segment with different filter logic. A Marketo engagement program has no direct counterpart at all.

So every project starts with a detailed map of the source platform. Which fields exist and which ones hold data. Which programs run, what triggers them, which emails they send and under which conditions. Which integrations write into the account.

This mapping is where an AI coding agent pays off first. A Marketo account exports into hundreds of JSON files: field schemas, smart list rules, program trees, email HTML. Our developer uses the agent to summarize them and point out gaps, then checks the summary against the Marketo interface. The developer owns the map. The agent shortens the time it takes to build it.

The second payoff is repeatability. Once the map exists, scripts turn it into Mautic configuration. The same scripts run on the test environment and on production, as many times as needed.

For a broader view of what moves and what you rebuild, see Marketo to Mautic migration: what transfers and what you have to rebuild.

What does the working setup look like?

The setup is deliberately plain.

  • Claude Code in the terminal. The developer works with the agent from the command line, inside the migration repository. The agent reads files, proposes code and runs commands the developer approves.
  • One repository for the whole migration. It holds the exports, the scripts, the mapping and the documentation.
  • An agent instructions file. It tells the agent what the project is, how the environments work and which rules apply. Every session starts by reading it.
  • A validation checklist. It lists what has to be true after each run. The developer and the agent check results against the same list.
  • Working notes. Decisions, open questions and what was copied from where. The next session picks up where the last one ended.
  • A pipeline in plain Python. Three steps: export from Marketo, transform to the Mautic model, load into Mautic through its API. No framework and no hidden state.

Why plain Python? Anyone on the team can read it, and a reviewer sees exactly what a script does to the data.

The instructions file, the checklist and the notes matter more than they look. An agent session has no memory of yesterday. With shared context in the repository, every session starts from the same facts.

What are the stages of an agent-assisted migration?

We run the migration in eight stages. The agent helps in most of them. The developer signs off on each one before the next starts.

1. Inventory and export

The Marketo REST API returns more than most people expect. Here is the split we work with.

Comes from the Marketo APICopied by the developer from the Marketo interface
Field schema with types and API namesSmart campaign flow steps (Send Email, Wait, Send Alert, Change Program Status)
Contacts by ID, with consent and unsubscribe fieldsEngagement program streams: email order and cadence
Programs and smart campaigns, with their parent programCurrent smart list counts (the interface counter is often out of date, so refresh it)
Smart list rules with full filters, static lists, formsWhich flow step sends which email under which condition
Templates, snippets, My Tokens
Email HTML (raw and with tokens resolved), landing page content

Two details save time. The contact ID list comes from a CSV export of a smart list in the interface, and the Lead API then reads the contacts by ID. A smart campaign returns a flow ID, but no endpoint reads the flow behind it. So the developer opens the Flow tab of each campaign and copies the steps into a file.

That file is not a side note. The flow steps hold the real logic. In our project the shop activation campaign sent different emails depending on double opt-in status, an A/B split and the contact’s industry. All of that lived in the flow.

Export everything you can before the Marketo contract ends. After that date the API is gone. Any later fix has to work from your own files or from the Mautic database.

2. Analysis

With the exports in the repository, the developer uses the agent to build an inventory. Fields with fill rates. Programs and the campaigns inside them. Emails per program. Forms and the fields they write.

The agent is fast at this kind of cross-reference. Which fields does no form, list or campaign use? Which emails sit in programs that never ran? In our project the audit of 213 custom fields flagged around 30 as dead weight: social fields, inferred location fields and placeholders.

The developer then compares the inventory with the client’s own description. The brief said “a newsletter and two flows”. The inventory showed five automations, double opt-in with voucher codes, a second brand and housekeeping programs. That gap is normal. Our process catches it before the build.

3. Mapping decisions

This stage belongs to people. The developer and the client decide:

  • which fields move, which get renamed and which stay behind,
  • which data lives on the contact and which on the company,
  • how consent, unsubscribes and bounces map to Mautic fields and Do Not Contact reasons,
  • how each Marketo program becomes Mautic campaigns and segments,
  • which background programs to drop because Mautic or the sending service already covers them.

The agent can draft a mapping table from the exports. It cannot know that the client plans to identify companies by an SAP customer number, or that a field nobody fills is still required by an integration. Those answers come from conversations with the client.

The result is a mapping file in the repository. It is the single source of truth for every script that follows.

4. Script generation

Now the developer uses the agent to write scripts against the mapping file. One script per object type, run in dependency order:

  1. Custom fields (segments and emails depend on them).
  2. Segments, with filters rebuilt from the smart list rules.
  3. Email templates and emails.
  4. Forms and landing pages.
  5. Campaigns.
  6. Contacts, with consent fields and Do Not Contact entries.

Every script creates objects through the Mautic API. Each one checks first whether the object already exists, by alias or by name, and updates it instead of creating a duplicate. That makes every script safe to run twice.

5. Review

The developer reads every script before it runs. He checks the logic against the mapping file, the edge cases in the data and the API behavior he knows from earlier projects.

Mautic has a few API habits that only experience catches. The Companies API overwrites fields with empty values, so an empty string clears a field. A payload with field names that no longer exist still returns HTTP 200 and saves nothing. A script can look correct and still do damage. Review is where those cases get caught.

6. Dry run

The scripts run on the test environment first, against the full data set. Because they are idempotent, the developer can run them, check the result, fix the mapping and run them again. A dry run costs minutes, not days.

Each run writes a log: what was created, what was updated, what was skipped and why. The developer compares logs between runs. If a number changes without a reason, he stops and looks.

7. Validation

The validation checklist turns “looks fine” into checks with an answer. After each dry run the developer compares Mautic with Marketo: contact counts, segment sizes, Do Not Contact totals by reason, consent fields on a sample of contacts. The client’s marketing team then tests the flows they know best.

Browser checks ran through Chrome DevTools. The developer confirmed that forms submit and trigger the double opt-in email, that landing pages render at desktop and mobile widths, and that the console shows no errors while tracking requests fire.

8. Cutover

The final import is predictable because it is the same set of scripts the team has already run several times. On cutover day nothing new happens. The scripts run on production in the same order as on test.

Marketing does not stop during a migration. Contacts sign up, unsubscribe and change data after the main import. So a delta import before cutover moves every contact that changed in Marketo since the main run. Marketo kept running until the first Mautic sends were validated, which gave the client a rollback path.

For the planning side of this, see How to plan a marketing automation migration.

How do we migrate email templates?

Templates take more manual effort than data. Marketo email HTML does not drop into the Mautic builder as it is.

The developer used the agent to write converters that turn Marketo templates into Mautic templates. The output is not one long email. It is a library of about ten reusable blocks the marketing team drags in from the side panel of the builder. A second brand got its own header and footer on the same base.

Each converted template went through a pixel-by-pixel comparison with the Marketo original. Both versions render to images at the same width, and a diff highlights every pixel that differs. A shifted button or a wrong font size shows up at once. Without the diff, someone would have to compare dozens of emails by eye.

Personalization needed its own rewrite. The client’s Marketo emails used a Velocity script for German salutations: the right form of address depending on gender and title, with a neutral fallback when data is missing. The developer rewrote that logic in Twig. A rule like this needs a test case for every combination of values, empty ones included.

Mautic can also change content such as footers based on contact data. We used that for location-based content.

What goes into the agent instructions and the validation checklist?

Here is what we put into these two files on any migration. Adapt it to your own project.

The agent instructions file covers:

  • the goal and scope of the migration in a few sentences,
  • the repository layout and where exports, scripts, mapping and notes live,
  • how to run scripts and how environments are selected (by configuration, never by credentials in the text),
  • coding rules: plain Python, idempotent scripts, a dry-run flag, a log line for every write,
  • data rules: work from schemas and anonymized samples, keep the full contact export out of the conversation,
  • the mapping file as the only source for field names and target objects,
  • known platform quirks, such as the empty-value overwrite and the silent HTTP 200,
  • what needs explicit developer approval: any run against production, any delete.

The validation checklist covers:

  • contact totals in Mautic versus the source export,
  • segment sizes versus the source lists, with an agreed tolerance and an explanation for each difference,
  • Do Not Contact totals by reason (unsubscribed, bounced, manual),
  • consent fields filled and dates in the right format on a sample,
  • custom fields present with the right type and options,
  • emails: render check, working links, unsubscribe link, tokens resolved,
  • forms: submission saved, double opt-in email sent, confirmation recorded,
  • campaigns: entry conditions, hand-offs between campaigns, no contact in two overlapping drips,
  • logs reviewed with no unexplained errors or skips.

The working notes hold everything else: decisions with the reason behind them, open questions for the client and a list of assets copied from the interface.

Where does the agent save time, and where does the developer decide?

TaskHow the developer worksWhy
Reading and summarizing large exportsUses the agent for a first summary, checks itHundreds of files, repetitive work
Field inventory and fill ratesUses the agent for the cross-reference, checks itPure cross-referencing
Mapping decisionsDecides with the clientDepends on business goals and integrations
Consent and Do Not Contact mappingDecides with the clientLegal and reputational risk sits here
Person versus company data modelDecides with the clientHard to change after the import
Writing migration scriptsGenerates drafts with the agent, reviews each oneRepetitive code with clear rules
Template and landing page conversionGenerates converters with the agent, reviews outputMany similar files
Visual comparisonRuns the pixel diff, judges each differenceFast and exact, but someone decides what matters
Client conversations and scopeLeads with the project teamTrust and context
Approving runs and the cutoverApproves every runFinal responsibility

The pattern is simple. The agent helps most where the work is large, repetitive and verifiable. People decide wherever the answer depends on the client’s business, on consent or on a data model the team will live with for years.

Which guardrails do we use?

An agent that can run commands needs clear limits. These are the rules we follow.

  • No production credentials in prompts. Credentials live in environment files that the scripts read. The conversation never contains them.
  • Test environment first. Every script runs on test before production. A production run needs the developer’s explicit approval.
  • Idempotent scripts. Running a script twice gives the same result as running it once. A failed run can simply run again.
  • Logs for every write. Each run leaves a record of what changed. That record is how we answer questions weeks later.
  • Personal data stays where it belongs. The agent works on structure: field schemas, rules, templates, anonymized samples. The full contact export goes through the Python pipeline on the migration environment, not through the conversation.
  • Review before merge. Nothing the agent writes runs before the developer has read it.
  • Notes over memory. Decisions go into the working notes, so no session relies on what someone remembers.

These are our working practices. They do not replace your own data protection review, and we are glad to align them with your policies.

What does the client get from this way of working?

A repeatable migration. The same scripts build test and production. A rerun after a mapping change takes minutes, so late requests from the client do not threaten the deadline.

An auditable migration. The mapping file, the logs and the checklist results show what moved where and why. When someone asks why a contact is marked as Do Not Contact, there is an answer with a reason code behind it.

A calmer cutover. The final import is a known procedure, and the delta import closes the gap to go-live.

Time spent on decisions. Less developer time goes into reading exports and repetitive code. More goes into mapping, consent and testing with the client’s team.

FAQ

Does the AI agent see our contact data? Our practice is to keep it out of the conversation. The agent works with field schemas, rules, templates and anonymized samples. The Python pipeline processes the full export on the migration environment.

Does the AI agent decide how our data is mapped? No. The developer and your team decide the mapping. The agent drafts tables and scripts from those decisions, and the developer reviews every one.

Can you migrate the parts of Marketo that the API does not return? Yes. The developer copies smart campaign flow steps and engagement program streams from the Marketo interface into files. From there they go through the same scripted process as everything else.

What happens if our Marketo contract ends during the project? Export everything to files before the end date. After it, later fixes work from those files or from the Mautic database. We plan the export as an early milestone for that reason.

Do the same methods work for HubSpot or Pardot? Yes. The export and analysis steps change with each source platform, because every platform has its own API. The load side, the guardrails and the validation checklist stay the same.

Leaving Marketo and want a migration you can audit?

This is one of the building blocks of our Marketo to Mautic migration for Meesenburg.

Tell us which platform you run today and when your contract ends. We will map your account and show you how the migration will run, stage by stage. Talk to us about your Mautic migration.

Tags

#Mautic#Marketo#Migration#AI#Claude Code
M

Written by

Mautomic Team

Mautic experts sharing insights on marketing automation, custom development, and open-source technology.

Need help with Mautic?

Our team of experts is ready to help you implement and optimize your marketing automation.

We'll get back within 24h. Privacy Policy