Running large Mautic imports and exports in the background

Large Mautic contact files should not run through the browser. This page explains how background imports by cron and scheduled exports work, what to prepare in the file, and what to confirm in your release before you plan the work.

On this page

Why large Mautic imports and exports belong in the background

A marketing or data team that needs to load or pull a large contact list usually hits the same wall: the browser upload stalls, the session times out, and nobody can tell whether the import finished. Background processing moves that work off the web request, so the job runs on the server while the browser is free to close. This page covers three parts of that path: the cron-driven CSV import, exports that are prepared on the server and sent as download links by email, and the file preparation rules that decide whether a job succeeds on the first attempt.

Background jobs in Mautic depend on the server being ready for them. The Mautic cron jobs documentation describes scheduled commands for segment updates, campaign updates and campaign triggers, which should be staggered, along with a messenger consumer for queued work. A large import or export is only as reliable as those workers, so confirm that cron and the messenger consumer are installed, running under a process manager and logging errors before you schedule a large job. Check the cron and worker setup against the documentation for the release line you run, since command names, options and scheduling advice change between versions and should not be copied from older guides.

Before any job runs, decide who owns the file and who receives the result. The team that prepares the CSV needs a written column layout, an agreed encoding and a test file of a few hundred rows that runs end to end in a non-production instance. For exports, confirm which fields, filters and recipients the export option supports in your release, and who may request one, because an emailed download link carries contact data and should be treated as sensitive. A reader who settles those questions first will spend far less time diagnosing a failed job at the end of the week.

Import and export options and when each fits

This table compares four ways to move contacts in or out of Mautic, from browser uploads to scheduled exports. Read each row against your file size, how often the job runs and who needs the result, then check the dependencies before committing to a path.

OptionBest suited toTriggered by and dependenciesMain trade-off
Browser upload for small filesSmall, one-off contact lists that finish well within a normal web requestAn admin in the browser. Depends on PHP upload and execution limits and the web server timeout.Fast to start, but large files can hit timeouts or memory limits and fail partway through.
Background CSV import by cronLarge contact files that need to load without holding a browser session openScheduled cron job processes queued import files. Depends on cron running on the server, correct file ownership and a staggered schedule.Reliable for big files, but the admin must check results later and a stalled cron leaves the import waiting.
Scheduled export emailed as a download linkRecurring pulls for sales, operations or reporting teams who need the same contact subset on a rhythmScheduled task generates the file. Depends on cron, a working mail transport and storage space for the generated file.Hands-off once configured, but download links are only as safe as the mail route and link access rules you set.
Manual export for one-off pullsAd hoc requests, such as a single audit or a segment handed to a partner onceAn admin from the interface. Depends on PHP limits and the time the export takes on the current data volume.Quick and controlled, but it does not repeat, and very large exports may need the background route instead.
File preparation before any importEvery import regardless of size, since encoding and column errors cause most failed loadsDone by the team before upload. Depends on agreed column headers, consistent encoding and a clean test file.Adds upfront review work, but it reduces failed runs and duplicate or mismatched contact records.
Choosing between cron and browser for a given fileDeciding which route a new list should use before it is uploadedDepends on the list size estimate, how urgent the result is and whether someone will watch the job.Background routes add waiting time, so set expectations with the requesting team in advance.

How to set up background imports and exports step by step

This sequence confirms the release, scheduling, mail delivery and file locations first, then proves each path with a small test before production jobs run. The result is a background import and export process you can check at every stage.

  1. Confirm the release and PHP version

    The administrator confirms the installed Mautic release and the PHP version on the server against the requirements page for that release. Mautic 7.2 supports PHP 8.2 to 8.5 with active and security support until 30 September 2026, and Mautic 7.3 is planned as the long-term support release with security support through 31 December 2027. Check the release line in the admin system information, then confirm the PHP version from the command line. The step is done when both match a supported combination for the planned maintenance window.

  2. Confirm the cron schedule and stagger jobs

    The administrator lists the current crontab entries and confirms that the background import and export commands are scheduled alongside segment, campaign and trigger jobs. The cron documentation says these jobs should be staggered, so each new entry gets its own start minute. Review the job log after a scheduled run to confirm that the jobs start and finish without overlapping. The step is done when every job appears once, at a distinct offset, with a logged start and finish.

  3. Confirm the mail transport for export links

    The administrator confirms that Mautic can send email through the configured transport, since an export is delivered as a download link. If email is queued, a messenger consumer must also be running, as the cron documentation describes. Send a test message from the Mautic configuration to a mailbox your team controls. The step is done when the test message arrives, the sender and reply-to fields are correct, and the consumer shows as running.

  4. Set file locations and permissions

    The administrator creates or confirms the import folder and the export output folder that your release documents, then sets ownership so the user running the cron jobs can read and write them. The export folder should not be publicly browsable, and downloads should go through the emailed link. Use a listing of the directories to check owner and permissions, then have the cron user create and delete a test file in each folder. The step is done when both folders show the expected owner and the cron user can write to them.

  5. Run a small test import

    The administrator places a small CSV in the import folder that contains a few rows covering every mapped field, including a duplicate email and one deliberately invalid row. Run the import command manually, then review the job log for row counts and errors. The file should move from the incoming location to the processed folder once the run completes. The step is done when the expected contacts exist with correct field values, the invalid row appears in the error output, and the source file has moved to the processed folder.

  6. Run a test export and open the link

    The administrator starts a test export from a small segment whose size is known, then waits for the job to finish. The export email should arrive at a test mailbox with a download link. Open the link from that mailbox, not from the admin session, to confirm that access works as intended. Compare the column headers and the row count with the segment. The step is done when the link downloads the file, the columns match the mapping, and the row count matches the segment.

  7. Schedule and monitor production jobs

    The administrator adds the production import and export jobs to the cron schedule at their staggered offsets and records the schedule in the runbook. Large files can be split into smaller batches, and you should confirm any file size or row limits for your release with the documentation before you set batch sizes. Review the log after the first scheduled run and the processed folder the next day. The step is done when the first scheduled runs complete, failed runs trigger an alert your team reads, and the owner of each job is named.

How a background import moves from file drop to contact records

A marketing team places a prepared CSV in the import folder, and cron triggers the import command on the Mautic web server. The command reads rows in batches and writes contacts and fields to the database, so no browser session needs to stay open. Failed rows and the final status go to an error report in file storage. Exports run on their own cron trigger: the export command reads contacts, writes a file to storage, and emails a link to the requester. Check that the link expires or is removed as your policy states, and that the database and file storage sit inside the trust boundary you approved.

Import and export paths across the Mautic host, database and file storage.

File preparation rules that stop imports failing silently

Most failed imports are caused by the file, not the server. The rules below are checked by the data owner before upload, so that a background job does not quietly skip rows, map values to the wrong fields or create duplicate contacts. Each rule is cheap to check on a sample and expensive to discover after a full load.

Consistent UTF-8 encoding and delimiter

Save the file as UTF-8 with one delimiter used everywhere, and keep that choice the same across every export your team produces. Spreadsheet tools often save as a regional encoding or change commas to semicolons, which can turn accented names into garbled characters or push every value into the wrong column. Open the file in a plain text editor before upload and confirm the delimiter and encoding match what the import form expects.

Header aliases that match contact fields

The header row must use field aliases that Mautic can map to its contact fields, so the mapping step needs no guesswork. A column named "E-mail address" or "Phone (work)" may be left unmapped, which means the data is dropped without a visible error. Compare every header against the contact fields configured on your instance, and rename custom fields before the file is prepared rather than after the job has run.

Cron jobs docs

One record per row with a unique identifier

Each row should describe one contact and carry a stable unique identifier, such as an external ID or a unique email address. Merged cells, multi-line values and rows that combine two people can shift every later column or create contacts that conflict with existing records. Without an identifier, re-running an import after a partial failure can produce duplicates that are hard to separate from genuine contacts.

Normalized email addresses

Trim spaces, lowercase the domain and remove invisible characters from every email address before upload. Addresses with trailing spaces or pasted formatting often fail validation or match the wrong existing contact, and a single bad address in a large list is easy to miss. Run a quick check for empty, malformed and duplicated addresses on the full file, since a background job reports problems in logs rather than on screen.

Explicit consent and opt-out columns

Map consent and opt-out values to their own columns with agreed codes, such as one value for opted in and another for opted out, and never infer consent from a blank cell. Ambiguous values in a marketing list can mean contacts receive email they never agreed to, which is a compliance problem rather than a data problem. Confirm with your compliance owner which fields and codes apply before any row is loaded.

A test file checked before the full load

Build a small test file from representative rows, including accented names, missing values, duplicates, unsubscribed contacts and every custom field. Run it through the same background import path and check the created or updated contacts, the field values and the job log before loading the full list. Illustrative example: a file with one row per edge case reveals a column mismatch in minutes, while the same mismatch in a full list affects every contact.

Which path fits each team's job

A legacy list usually arrives once, as a large file exported from an older tool or spreadsheet. The migration lead owns the file and the field mapping, and nothing is queued until that mapping is signed off. The import runs through Mautic's background import process, so the cron job that processes the import queue must be active before the upload starts.

  • File ownership: the migration lead owns the source file, the mapping sheet and an untouched copy of the original export.
  • Command: the import is processed by the import command on the schedule set in your cron configuration. Confirm the exact command and interval for your version in the Mautic cron jobs documentation.
  • Consent fields: confirm which opt-in and preference fields the legacy list actually holds. Blank consent columns can later read as unknown, which changes how those contacts can be marketed to.
  • Duplicates: if the match rule uses email alone, variant addresses in the legacy list will create duplicate contacts. Decide the matching key before the full run.
  • Trial run: load a small test file first and compare row counts and field values against the source.

Confirm the consent mapping and the duplicate rule with the business owner before the first full load.

Security and access controls for files and exports

Background imports and exports move personal data through server folders, job queues and download links outside the normal browser session. The cards below cover who can place and request files, how links and logs are protected, and how files are removed and recorded.

Who can place import files

Decide who may drop CSV files into the import location before any job runs. Limit write access to a named group, such as the marketing operations team, and keep it separate from general server administration. Treat every file as personal data from the moment it lands. Confirm whether your release restricts the import folder by user or only by filesystem permissions, and document the owner of that folder.

Who can request exports

Exports carry the full contact history, so the right to start one needs its own decision, separate from the right to edit contacts. Map which Mautic user roles can trigger an export and which can only view results. Review that mapping after every staff change. Confirm with the vendor documentation for your release how export permissions are checked, because the authentication docs cover sign-in methods, not export authorization.

Mautic authentication docs

Least-privilege server folders

The Mautic process needs read access to import files and write access only to the export location. Keep those folders out of the web root so a file cannot be fetched by URL. Give the cron user and web server user the narrowest permissions that let jobs succeed, and check ownership after each update, since wrong ownership is a common cause of failures.

Protecting and expiring export links

An emailed export link works as a bearer credential, so anyone who receives it can download the file. Ask how each link is generated, whether it is random and unguessable, whether it expires, and whether it can be used more than once. If your release cannot time-limit links, restrict who receives them and move large exports to a controlled transfer location.

Personal data in temporary files and logs

Partial imports, error reports and job logs often repeat email addresses and names. Confirm which temporary files Mautic writes during processing, where they are stored and who can read them. Keep logs free of full records where possible, and restrict log access to the same team that owns the import process.

Retention, deletion and audit records

Set a written rule for how long source CSVs and exports remain on disk, then delete them on schedule and keep a record of each deletion. Record who started each job, when it ran, the file name and the row counts. These records give auditors evidence of control, so store them somewhere the operators of the job cannot edit.

Checks to run after every scheduled import and export

Start every review with the job output itself. Compare the rows created, updated and rejected counts against the number of data rows in the source CSV, and treat any gap as unexplained until you have found the reason. Rejected rows are the ones that need follow-up: pull them from the run output or log, group them by cause (missing email, malformed date, unknown owner or a field that does not map to a contact property) and fix the source file rather than the imported records. Also confirm the export side the same way: the row count in the exported file should match the segment size you expected when the export was scheduled, and the download link should resolve for the intended recipient only.

Next, confirm that the automation that reads contacts is still running. Segment and campaign cron jobs are separate from the import, so a successful import does not mean new contacts have been evaluated. Check that the segment update and campaign update jobs have completed on schedule since the import finished, and that new contacts appear in the expected segments. If the import also triggers emails or campaign actions, watch the queue backlog on the messenger consumer until it drains. A growing backlog after a large load is a signal to pause further imports and review worker capacity before sending more.

If a job stops partway, do not correct records by hand in the database. Instead, identify the last completed state from the run output, restore the affected data if needed from a backup taken before the run, and re-run the import from the same unchanged source file so the outcome is repeatable and auditable. Keep the original file under version control or in a write-protected location for this reason. Take a full backup before any large bulk change, including the import itself and any cleanup that follows it, and confirm the restore works in a separate environment. The Mautic cron jobs documentation covers the scheduled commands your team should verify after each run.

Limits to confirm before you commit to a large load

A large import or export puts load on the same host, database and mail path that serve your live marketing work. The cards below list the limits to confirm in your own release and environment, using the vendor docs and a test run on a copy of your data before you schedule the real job.

Available commands and options

Confirm the exact import and export commands, their options and their batch behavior in the Mautic release you run. Command names and flags differ between releases, so a runbook written for one line may fail on another. Run each command with a dry or small file in a staging copy and record the output, the log location and the exit status. Keep that record with your change notes so the next upgrade does not start from memory.

Mautic cron jobs docs

PHP memory and execution limits

Read the memory_limit and max_execution_time values that apply to the PHP process running cron, not only the ones shown in the web admin. CLI and web PHP often load different php.ini files, so a value that works for browser uploads may not apply to a command run from cron. Test with your largest realistic file and watch peak memory in the job output before you set the schedule.

VPS or dedicated hosting

Confirm that the host is a VPS or dedicated server. The Mautic project states that Mautic should not run on shared hosting and recommends a VPS or dedicated server instead. Shared plans usually cap process time, memory and background jobs, which makes long imports and exports fail in ways that look like application bugs. Ask your hosting provider in writing whether long-running CLI processes are allowed and how they are limited.

Mautic requirements

Mail transport limits for export links

An export emailed as a download link depends on your mail transport accepting the message and the recipient's mail system allowing the attachment or link. Check your transport's per-message size, rate and daily sending limits, and whether it blocks certain file types. Confirm the link lifetime and who can open it, because a link to a contact file is personal data. Test with a file of realistic size and check delivery to each mailbox provider your audience uses.

Database capacity and indexes

Large contact tables grow the database faster than most teams expect, and imports that match on email or unique fields rely on indexes being in place. Confirm the database engine, the storage headroom for a full import plus its backup, and how long a bulk write takes on a copy of production. Plan which indexes and maintenance windows you need before the first large run, and confirm the storage engine supported by your release with the requirements page.

Mautic requirements

Competing cron and queue jobs

Segment updates, campaign updates, campaign triggers, broadcasts and the messenger consumer all run on the same host and often the same database. A large import scheduled alongside them can slow campaign sends or delay email. Map every scheduled job and its run window, stagger the start times, and measure the load of each job during a test. Decide in advance which jobs pause during the large run and who approves that pause.

Mautic cron jobs docs

Official sources to check for command names and scheduling

Before you schedule any import or export job, read the Mautic cron jobs documentation for the exact release you run, because the command names, option flags and export behavior described for one line can differ from another. The Mautic cron jobs documentation is the natural starting point for how background work is scheduled, including the guidance that cron entries should be staggered so jobs do not compete for the database at the same moment. The docs page is versioned under the 5.x path, so confirm that the release on your server matches the version your team is reading, and check the Mautic releases page for the current support status of your line before you build a schedule around it.

Use the How to install Mautic documentation to confirm how your instance was installed, since the installation method affects where the console command runs and which user owns the files it writes. Composer-based installs and the production package can differ in paths and in how the command is invoked. Ask your platform owner to record the exact release, the cron user and the working directory in your runbook, then test each scheduled command once by hand in a non-production environment and compare the output with the documented behavior. Any difference you find between the docs and your environment should be resolved with Mautic's own documentation or community channels before the job goes into production.

What large Mautic imports and exports cost and require

What drives the effort of a large Mautic import or export?

The effort is driven mostly by the quality of the file, not its row count alone. Files with inconsistent headers, duplicate emails, mixed date formats, unmapped custom fields or missing consent values take longer to map, test and correct. Server capacity matters next, because a background job competes with cron jobs, queue workers and web traffic on the same host. The number of recurring jobs also adds work, since each scheduled import or export needs its own owner, monitoring and retained files. Ask any provider to scope these four areas separately so you can see where the hours go.

Can our own admin team run large Mautic imports without a partner?

Yes, a trained Mautic administrator can run imports in-house when three conditions hold: the file has been tested on a copy of the instance, the field mapping is documented, and a written runbook covers the cron command, the expected result and the rollback steps. Bring in a partner when the mapping involves several source systems, when consent records must be reconciled, when the server is shared with production traffic, or when no one on the team has run a background import before. Your administrators should still own approvals and sign-off in either case.

What do we need to provide before an import or export project starts?

Plan to provide sample files that match the real source data, a written definition of each field and what it means in Mautic, the consent rules that apply to each contact source, and server access for the environment where the job will run. You also need a named owner who can approve mappings, test results and the go-live date. Missing consent rules are the most common blocker, because contacts without a clear lawful basis or recorded opt-in status cannot be loaded as marketable without a decision from your legal or compliance team.

How should we plan the time for a first large Mautic load?

Plan the first load around its drivers rather than a fixed number of hours: the size and cleanliness of the source file, how many custom fields need mapping, how many test cycles your consent and data owners need, and how much capacity the host can spare during the run. A first load usually takes longer than a repeat load because mapping rules are still being settled. Ask any provider to show the test cycles, the staging environment used and the point where your owner signs off, then build your calendar from those milestones.

What is one-time work and what recurs after a large Mautic import or export?

One-time work includes profiling the source file, designing the field mapping, building and testing the import file rules, configuring the cron entries, and running a full dry run in a non-production environment. Recurring work includes running scheduled imports and exports, watching job logs and failure reports, reviewing the exported files, and deleting or archiving old download files according to your retention policy. Recurring work usually grows with the number of scheduled jobs, so define the count and frequency up front.

Which export files and download links need security controls?

Exports can contain personal data, so treat emailed download links as sensitive. Confirm who may request exports, which fields they may include, how long the files stay on the server, who can access the link and whether the link expires. Restrict the export folder to the account that runs Mautic, and do not store files in a public web path. Your compliance team should approve the retention period before the first scheduled export runs, and the approach should match your organization's data handling policy.

What should we ask for in a written quote for a Mautic import or export project?

Ask the provider to state the scope in writing: the source systems, the number and types of fields to map, the number of test cycles, the cron jobs to configure, the monitoring and logging to set up, and the handover documents to deliver. Request a clear split between one-time setup and recurring support, the client responsibilities listed earlier, the acceptance criteria for each deliverable, and what happens if the source file changes after sign-off. A fixed-scope quote with a clear change process is easier to compare than an open-ended estimate.

How DeployOpen scopes and delivers Mautic import and export work

DeployOpen treats large Mautic contact imports and exports as a planned piece of work inside the client's own infrastructure, not a one-off upload. The engagement covers the cron jobs, file preparation rules, permissions, and the handover documents your operations team needs to run the process again without us.

How we scope

  • Written scope lists the import and export jobs, source and target files, and the contact fields each one touches.
  • We review the current hosting, PHP settings, and cron setup to identify where background jobs will run.
  • Engagements are fixed-scope, with deliverables and timelines agreed in writing before work starts.

How we build

  • We configure the background import by cron path and define the CSV file preparation rules agreed with your data owners.
  • We set up scheduled exports that send download links by email, with file retention and access rules documented.
  • We test each job on a copy of your data in a separate environment before any run touches production contacts.

How we hand over

  • You receive a runbook covering file naming, staging folders, cron schedules, and how to read job logs.
  • We document the consent and field-mapping checks your team performs before each import goes live.
  • Your administrators receive a walkthrough so they can start, stop, and verify jobs without DeployOpen involvement.

How we support

  • Ongoing support, upgrades, and continuous testing are available as a retainer if your volumes or Mautic releases change.
  • We review job logs and failed runs with your team and adjust cron timing when campaign and segment jobs overlap.
  • Retesting follows any Mautic upgrade so that import and export jobs keep working on the supported release line.

Sources and further reading

Talk to our team.

Tell us what you're working on, whether it's a deployment, an audit, a security test or a cyber range. You'll speak with an engineer who can help you scope it.

  • 30-minute call: free, with no obligation.
  • NDA on request: we can sign before you share details.
  • Clear next steps: a scope and plan after the call.