Backing up and restoring Mautic

A usable Mautic backup covers the database, application files, configuration and media, and it is only proven once a restore has run in a separate environment. This page explains what to include, how to set it up and what to confirm.

On this page

What a usable Mautic backup includes and when you need one

A self-hosted Mautic instance holds contact records, consent and preference history, segments, campaigns and email activity, and that data has to be recoverable before any update or cleanup job runs. Mautic is GPL-3.0 open source software with no paid edition, so nobody sells you a managed backup product for the platform itself. The backup, restore and hosting work belongs to the team running the instance, and that team has to define what a usable backup contains before it needs one.

A restore needs three groups of material. The first is the database, which holds contacts, segments, campaign state, the audit and consent records you may be asked to produce, and the queued messages. The second is the files and configuration, including the local.php configuration file that holds database credentials, mailer and cache settings, and any plugins or themes installed under the application tree. The third is the media folders where uploaded images, assets and downloadable files live. A database dump without the matching files often restores into an instance that cannot start, and files without the database hold no contact history. Confirm with your own environment which folders your installation writes to, and check whether your cache and log locations need to be included or can be regenerated.

A backup that has never been restored is unproven. Before every Mautic update, restore the latest backup into a separate environment with the same PHP, database and web server versions, then confirm that logins work, contact counts match, a test campaign can be built, and the messenger and cron jobs run against the copy. Take a fresh backup immediately before running any cleanup command, because permanent deletion cannot be reversed from the live system. Document who holds the backup credentials and where the copies are stored, since a restore plan that depends on one engineer's workstation is not a plan.

Which Mautic components a restore depends on

A Mautic restore is only as good as the set of components it brings back together. The database, application files, media, scheduled jobs, web server and domain settings each hold part of the running system, and a gap in any one of them can leave an instance that starts but behaves incorrectly. Confirm each item against your own install before you rely on the backup.

Database with contacts and consent

The database holds contacts, segments, campaigns, forms, email history and consent records, so it is the core of any restore. Take it with the application files in the same backup window so the schema and code match. After restoring, check that segment membership, campaign state and do-not-contact flags look the same as before the failure, because consent records are the part you cannot rebuild from memory. Confirm the database engine and version your instance runs, since restore tooling must match it.

Mautic requirements

Application files and local configuration

The application code and the local configuration file hold the database connection details, the secret values and the site settings that tie the code to the data. A backup of the database without the matching code version can fail during schema checks. Record the exact Mautic release in use before the backup, and keep the local configuration file out of any shared or unencrypted location because it contains credentials.

Uploaded media and assets

Images, attachments and other files uploaded through the email builder, landing pages and file fields live outside the database. If they are missing after a restore, emails and pages will show broken links even though the contact data is intact. Ask your team where uploads are stored on your server and whether any are kept in external storage, then include that location in the backup job and test one restored image.

Cron and messenger setup

Scheduled jobs for segment updates, campaign triggers, broadcasts and the messenger consumer are not stored as data, so a restored server starts without them unless you recreate them. Segments stop updating and queued emails stop sending until the jobs run again. Keep a written record of every scheduled command, its interval and the process manager that keeps the consumer running, and verify each one on the restored server.

Web server and PHP settings

Web server virtual host rules, PHP version, extensions and limits are server state rather than Mautic data. A restore onto a server with a different PHP version or missing extension can produce errors that look like data corruption. Record the PHP version, the enabled extensions and the web server configuration, and confirm they match the Mautic requirements for your release line before you point traffic at the restored instance.

Domain and SSL configuration

The public domain, the certificate and the proxy or load balancer settings determine how visitors, tracking scripts and email links reach Mautic. A restored instance on a new address can send tracking and unsubscribe links to the wrong host. Confirm the site URL setting, the certificate renewal process and any DNS records in your runbook, and test a tracked link and an unsubscribe page on the restored environment before cutover.

Why restores must be tested before every Mautic update

A backup you have never restored is only a hope, and Mautic gives you a reason to test it often. The project ships monthly patch releases, minor releases every three months and major releases every two years, so a production instance will go through updates regularly. Each update changes the application code and can run database migrations, which means the moment before an update is the moment a broken backup matters most. Before every update, restore the latest database dump and the application files into a separate environment, then run the same Mautic version you are about to leave and confirm it starts cleanly. Keep the restored copy off the live sending path so it cannot send email, poll a CRM or fire campaign actions against real contacts while you test.

Match that test environment to the supported baseline so the result means something. Mautic 7.0 requires PHP 8.2, 8.3, 8.4 or 8.5, MySQL 5.7 or higher with InnoDB or MariaDB 10.2 or higher, and npm from Mautic 5.0 onward. Confirm the PHP and database versions in your test host match production, because a restore that works on a different PHP build proves little about the real upgrade. Once the restored copy is running, check four things: you can log in with an existing user account, a sample of contact records shows the expected fields and timeline history, a known segment rebuilds to a plausible count, and a campaign loads with its steps intact. Record what you checked and the results. If the restored instance fails any of these, the update is not ready to run on production, and you have learned that while the live system is still untouched. Ask your partner or internal team to name who owns this sign-off before the update window opens.

Backup approaches by hosting setup and team size

On a single VPS, the web server, PHP, the database and the Mautic files usually share one machine, and the same small team often owns all of them. Mautic's project states it should not run on shared hosting and recommends a VPS or dedicated server instead, so this setup is the common minimum. Backups are usually scheduled jobs you configure yourself, which means nothing is protected unless someone wrote the job, tested it and monitors it.

  • Database dumps: a scheduled dump of the Mautic database, stored off the server, is the piece most likely to be missing or stale.
  • Files and configuration: the local.php configuration file, the media folder and any custom plugins or themes must be captured alongside the database.
  • Restore ownership: the same people who run the server usually perform restores, so the runbook needs written steps they have actually rehearsed.
  • Off-server copies: a backup stored only on the VPS disappears with the VPS, so confirm where copies go and how long they are kept.
  • Snapshots: a provider snapshot can help with whole-machine recovery but may not be consistent with a running database, so check it before relying on it.

Confirm with your hosting provider which snapshot and backup features exist, what they capture and whether they cover the database consistently. Your own dump and file jobs remain your responsibility either way.

Backup options and when each fits

This table compares the four backup approaches a team typically chooses between for a Mautic instance: database dumps, file copies, full server or volume snapshots, and offsite copies. Read each row for what it captures, how hard it is to restore, and how safe it is while Mautic is writing to the database. The main takeaway is that a usable backup pairs a consistent database dump with the Mautic file set, and that a snapshot alone rarely proves a restore works.

OptionWhat it capturesRestore effort and consistency riskWhen it fits
Database dumpMautic tables holding contacts, segments, campaigns, events and email history, taken with a logical dump toolModerate effort: load into a clean database, then point the restored files at it. Consistent only if taken with transactions or during a quiet window, since cron jobs and queue workers keep writingAlways part of the backup set, and the primary source before updates and cleanup commands
File copy of the Mautic installConfiguration file, media and uploaded assets folders, and any custom plugins or themes, but not the databaseLow to moderate effort: copy back and fix ownership. Config and media must match the database dump taken at the same point, or contacts and assets can drift apartRequired alongside every database dump; confirm which folders hold your local configuration and media in your install
Snapshot of the full server or volumeOperating system, PHP and web server settings, the install, and the database files if the volume holds themFast to revert a whole server, but restoring a live database snapshot can produce an inconsistent state unless the database is quiesced first. Restoring one file out of a snapshot is often slowUseful for rebuilding the host after a failed change; pair it with a logical database dump rather than relying on it alone
Offsite copyCopies of the dump and file set stored in a separate location, account or region you controlEffort depends on transfer and retrieval steps. Consistency risk is the same as the source copy, so the timing rules still applyProtects against loss of the server or its cloud account; confirm retention, encryption and access rules with your security team
Restore test in a separate environmentA restored copy of the dump and files running on a second host with the same PHP and database versionsAdds setup time for each test but is the only check that the backup works. Test before each update, not just on a scheduleRequired before every Mautic update and before cleanup commands that delete data

Setting up a backup and restore routine for Mautic

This sequence turns Mautic backups into a routine you have proven: every copy is stored off the production server, taken before risky changes, restored into a separate environment, and checked against a working instance. The result is a runbook your team can follow without guessing.

  1. Inventory the install and its configuration

    Record everything a restore would need: the Mautic release and PHP version, the database engine and version, the web server and proxy setup, the domain and environment settings, the cron jobs and messenger consumers that run against the instance, and any plugins or custom themes. Include the locations of the configuration file, the media and file folders, and any cache or log paths you intend to keep. Confirm the exact list against the installation and the cron jobs documentation for your release line. Done when someone outside the team could read the inventory and identify every item that must be copied.

  2. Schedule database and file backups

    Set up scheduled backups of the Mautic database and of the file locations recorded in the inventory, including the configuration file and the media folders that hold uploaded assets. Run the database dump in a way that produces a consistent snapshot for your engine, and confirm the schedule with the database vendor's guidance. Record the schedule, the retention rule and the owner of each job. Done when the first scheduled run completes without errors and produces files of the expected type and size.

  3. Store copies outside the production server

    Send every backup to storage that is separate from the production host, such as a different network location, object storage or a backup platform your organization controls. Encrypt the copies and restrict access to the people who run restores. Keep the encryption keys stored apart from the backups themselves. Done when a backup file can be listed and downloaded from the storage location by the restore operator, and when you can show that the production server cannot delete the only copy.

  4. Back up before every update or cleanup

    Before any Mautic update, schema change, or cleanup command that permanently deletes data, take a full backup manually and label it with the release, the command and the date. Do not rely on the scheduled job alone for these points, because the scheduled copy may be older than the change. Cleanup and deletion commands should only run after this backup is confirmed in storage. Done when the labeled backup exists in the external store and the change ticket references its name.

  5. Restore into a separate environment

    Restore the latest database and file backups into a non-production environment with the same Mautic release, PHP version and web server settings as production. Point the restored instance at a test domain so it cannot send email to real contacts or trigger live campaigns. Disable outbound mail and any CRM or webhook connections during the test. Done when the restore completes without manual database repairs and the instance starts.

  6. Verify the restored instance

    Check that a restored admin user can log in, that contact, segment, and campaign records are present and match production counts at the backup time, and that uploaded media and email assets load. Confirm the configuration file points to the test environment, and that the cron jobs and messenger consumers are recreated and set to run in the test host, not in production. If you run an update rehearsal, run the update in the test environment first and record any errors. Done when a named person signs off the checklist, including a login test and a sample of contact and campaign records.

  7. Document the runbook and test it on a schedule

    Write the runbook with the inventory, backup schedule, storage locations, access owners, the step-by-step restore procedure, the verification checklist, and the rules for backups before updates and cleanup. Include the commands and file names as they apply to your install. Schedule periodic restore tests and record the date, the backup used and the result. Ask your hosting provider and your database vendor to confirm any retention or point-in-time options that apply to your environment. Done when a second team member has followed the runbook from start to finish and logged the result.

Taking a backup before Mautic cleanup commands

Cleanup removes data permanently, so a current backup and a tested restore must exist before any cleanup command runs. Mautic's maintenance cleanup deletes rows from the database, and nothing in the command places a copy aside for you. A backup taken last month does not cover contacts, activity and campaign history created since then, so take a fresh database dump immediately before the purge, and confirm it is the same backup you would use to recover. Record the time and the command you plan to run next to the backup so the two can be matched later.

Restore the dump into a separate environment before relying on it. Check that the database loads, that the Mautic instance starts against it, and that a sample of contacts, segments and campaigns appears as expected. Include the configuration file and any media folders in the same backup set, because a database restore alone may not bring back everything the instance needs. Confirm with your own team how long a restore takes in your environment, since that time determines how far back you can recover if the purge removes something you need.

Treat dry runs and the GDPR option as changes to what is deleted, not as safety nets. A dry run shows the planned effect of a command, but it does not replace a backup, and the GDPR option can remove records that marketing reporting or consent evidence depends on. Confirm which records your legal and compliance owners require to keep before choosing options, and write that decision down. The cleanup topic in this series covers the command itself, its options and scheduling, so follow that guidance for the command and use this section as the checklist you complete first.

Security and operational risks in Mautic backups

A Mautic backup is a copy of the contact database, consent history and configuration, so it carries the same risk as production. The cards below cover the controls that decide whether a backup is safe to keep and safe to restore, from access and encryption to retention and where copies live.

Same access control as production

A Mautic database dump contains names, email addresses, consent and preference records, campaign history and often IP-linked tracking data. Store backups under the same access rules as the live instance, with named owners and logged access. Ask who can read the dump file, not only who can restart the server. Confirm that developers and agencies do not receive full copies by default.

Encryption at rest and in transit

Encrypt backup archives before they leave the Mautic host and encrypt the transfer to storage. Keep the decryption keys in a separate system from the backups themselves. Check that the backup tool, object store and any replication target all support encryption, and record which key protects which backup set so restores do not stall on a missing key.

Restricting who can restore

A restore overwrites live contact data, so it should need more approval than a backup. Limit restore rights to a small named group, require a second person for production restores, and log every restore event. Test restores in a separate environment first, as the page recommends, so that a restore into production is a deliberate and reviewed action.

Credentials in configuration files

The Mautic configuration file holds database credentials, mailer and API secrets, and may hold SAML certificate material or basic authentication settings. Decide whether these are included in the backup, and if so, treat the whole archive as secret material. A common alternative is to back up secrets from a secrets manager separately, with its own access list. Confirm the exact settings your SAML identity provider integration needs for a restored instance.

Retention that matches policy

Set retention periods from your data protection and records policy, not from storage convenience. Contacts who asked to be deleted may still appear in older backups, so ask how a deletion request is reflected in restores and how long old copies persist. Document the retention for database dumps, file archives and configuration snapshots separately, since they may differ.

Separate failure domains

A backup stored on the same disk, host, account or region as the Mautic server fails with it. Keep at least one copy in a different failure domain, such as another data center, cloud account or provider, and protect it from deletion by the same credentials that manage production. Test that the offsite copy can actually be restored, since an unreachable copy gives no recovery.

Questions buyers ask about backing up Mautic

What does it cost to back up and restore Mautic?

Cost depends on how much of the work is done once and how much recurs. The one-time work is designing the backup scope, writing the backup and restore procedure, and proving a restore in a separate environment. The recurring work is running backups, monitoring them, keeping the restore environment current and retesting after major changes. Effort rises with database size, the number of files in the media and configuration folders, how many environments must be rebuilt, and whether backups must meet retention or audit rules. Ask any quote to separate the design, the first restore test and the ongoing retainer, and to state what is excluded, such as storage costs in your own cloud account.

How long does a Mautic restore test take?

The duration depends on the size of the database, the volume of files, the speed of the storage you restore from, and how many systems must be brought back up with it. Restore time is also affected by whether the restore environment already matches production in PHP version, database version and web server configuration. Mautic's requirements specify MySQL 5.7 or higher with InnoDB or MariaDB 10.2 or higher, and PHP 8.2 to 8.5 for Mautic 7.0, so the test environment must run compatible versions before a restore can be verified. Ask for the test to be timed and documented so the figure can be repeated for planning.

What must our internal team provide for a backup project?

Your team should provide access and decisions, not just a server. The usual inputs are:

  • Read access to the production server, database and file storage, and a named owner for each.
  • The storage target for backups, with retention periods agreed by your security and compliance leads.
  • A separate test environment, or permission to create one in your infrastructure, with the same PHP and database versions as production.
  • The list of files that are not in version control, such as the local configuration file and the media and file folders.
  • A change calendar, so restore tests run before updates and cleanup jobs.
  • Someone who can approve restores and confirm the restored data is correct.
Can our own team set up Mautic backups without a partner?

Yes, if your team has Linux and database administration skills and time to test. The hard part is rarely the backup command. It is proving that a restore works end to end: the database, the files, the configuration and the cron and queue jobs that depend on them. Teams often miss the media and configuration folders, or never run a restore into a clean environment. If you build it yourself, schedule a full restore test before every update and before any cleanup command that deletes data, and record the result. A partner is most useful when you need the design reviewed, the test automated or evidence prepared for an assessment.

How often should we back up Mautic?

The frequency should follow how much contact and campaign data you can afford to lose and how often data changes. A busy instance with active campaigns and frequent imports usually needs more frequent database backups than a small one. Take a fresh full backup before every Mautic update, before running maintenance cleanup, and before any bulk import or deletion. Set retention based on your recovery needs and your data protection obligations for marketing contacts. Document the schedule, confirm that backups complete and test a restore on a regular cadence, not only when a problem occurs.

Does managed Mautic hosting remove the need for our own backups?

Not necessarily. Mautic has no paid edition of the software itself, and mautic.org promotes separately managed Mautic and Mautic hosting services. Before you rely on a host, confirm in writing what it backs up, how often, where copies are stored, how long they are kept, whether restores are tested, who can request a restore and how long a restore takes. Also confirm whether the backups include your configuration, media, custom plugins and the scheduled jobs that depend on them. Your own compliance team may still need evidence of data recovery whichever provider you use.

What happens if a Mautic update fails and we have a backup?

A tested backup lets you return to a known working state. Restore the database and files into the environment you prepared, confirm the Mautic version and PHP version match what was running before, and then check login, contacts, segments, campaigns and the scheduled jobs. Do not restore over production until the restored copy has been checked. If the update failed partway, the database may already have been changed, so the backup taken before the update is the reference point. The procedure for diagnosing stalled updates is covered separately, but without a restorable backup, recovery options are limited.

How backups, the test environment and updates fit together

The flow starts at the production Mautic application, which writes to its database and file folders. A scheduled backup captures both, and a copy goes offsite so it survives a failure on the server. Before any update or cleanup command runs, a fresh backup is taken. The backup is restored into a separate environment, where the update is rehearsed and checked. Only after those checks pass is the same update applied to production, so the team knows the backup actually restores.

Backups feed a tested restore before any update reaches production.

How DeployOpen scopes and delivers Mautic backup and restore work

DeployOpen plans Mautic backup and restore as a written scope agreed before any work starts, carried out inside the client's own cloud accounts, data centers or air-gapped networks. The first deliverable is an inventory of components: the database, the application files, the local.php configuration file, the media and asset folders, any custom plugins or themes, the web server and PHP settings, and the cron and messenger setup that the instance depends on. Each item gets a named owner, a storage location, a retention period set by the client, and a note on whether it can be recreated from source or must be captured from the live system. Mautic's cron and messenger processes are part of this inventory because a restored database without matching queue state can leave jobs in an unexpected position.

The core deliverable is a tested restore in a separate environment, built from the backup itself rather than from the production server. DeployOpen restores the database and files into an isolated instance, runs the Mautic update checks, logs in with a test user, and confirms that contacts, segments, campaigns and email configuration behave as expected. The same environment is used to rehearse an update or cleanup command, so the client can see what a rollback would look like before it is needed. Confirm with your team which Mautic release line you run and check the current support dates on the Mautic releases page, because the restore runbook must match the version the backup came from.

The output is a runbook covering backup schedule, pre-cleanup and pre-update snapshots, restore steps, verification checks, and escalation contacts, along with a findings list and a retest after fixes. DeployOpen does not issue audit reports, attestations or certifications. Where the client needs evidence for an assessment, the runbook and restore logs are inputs that the client's auditor reviews. Ongoing work such as scheduled restore tests, runbook updates after each Mautic upgrade, and support during incidents can be placed under a retainer. DeployOpen does not publish a price list. A quote follows from the written scope, so ask for the component inventory, the restore test plan, and the handover format to be listed explicitly.

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.