> For the complete documentation index, see [llms.txt](https://mariadb.com/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://mariadb.com/docs/tools/mariadb-enterprise-manager/administration/backup-and-restore-of-enterprise-manager.md).

# Backup & Restore of Enterprise Manager

Note: This is about backing up the data, configuration and collected metrics of the Enterprise Manager (EM), not the databases.

## Backing up Enterprise Manager

{% stepper %}
{% step %}
**Stop the Enterprise Manager**

1. Go to the Enterprise Manager installation directory
2. Run `docker compose stop` to stop the Enterprise Manager
   {% endstep %}

{% step %}
**Create a directory for backups**

{% code title="Create the `backups` directory" %}

```bash
mkdir backups
```

{% endcode %}
{% endstep %}

{% step %}
**Take a backup of all the volumes**

{% code title="Back up all volumes" %}

```bash
docker run --rm --volumes-from enterprise-manager-grafana -v $(pwd)/backups/:/backups:Z alpine:latest tar -czf /backups/grafana-backup.tar.gz /var/lib/grafana/
docker run --rm --volumes-from enterprise-manager-prometheus -v $(pwd)/backups/:/backups:Z alpine:latest tar -czf /backups/prometheus-backup.tar.gz /prometheus/
docker run --rm --volumes-from enterprise-manager-supermax -v $(pwd)/backups/:/backups:Z alpine:latest tar -czf /backups/supermax-backup.tar.gz /var/lib/supermax/
```

{% endcode %}

The `backups` directory now contains the data from the Enterprise Manager.
{% endstep %}

{% step %}
**Start the Enterprise Manager**

1. Go to the Enterprise Manager installation directory
2. Run `docker compose up -d` to start the Enterprise Manager
   {% endstep %}
   {% endstepper %}

## Restoring Enterprise Manager Server

{% stepper %}
{% step %}
**Stop the Enterprise Manager**

1. Go to the Enterprise Manager installation directory
2. Run `docker compose stop` to stop the Enterprise Manager
   {% endstep %}

{% step %}
**Restore the backup of all volumes**

The backups are stored in the `~/backups/` directory.

{% code title="Restore backup to all volumes" %}

```bash
# Clear out any existing data first
docker run --rm --volumes-from enterprise-manager-grafana -v $(pwd)/backups/:/backups:Z alpine:latest find /var/lib/grafana/ -delete -mindepth 1
docker run --rm --volumes-from enterprise-manager-prometheus -v $(pwd)/backups/:/backups:Z alpine:latest find /prometheus/ -delete -mindepth 1
docker run --rm --volumes-from enterprise-manager-supermax -v $(pwd)/backups/:/backups:Z alpine:latest find /var/lib/supermax/ -delete -mindepth 1

# Restore the data from the backups
docker run --rm --volumes-from enterprise-manager-grafana -v $(pwd)/backups/:/backups:Z alpine:latest tar -C / -xzf /backups/grafana-backup.tar.gz
docker run --rm --volumes-from enterprise-manager-prometheus -v $(pwd)/backups/:/backups:Z alpine:latest tar -C / -xzf /backups/prometheus-backup.tar.gz
docker run --rm --volumes-from enterprise-manager-supermax -v $(pwd)/backups/:/backups:Z alpine:latest tar -C / -xzf /backups/supermax-backup.tar.gz
```

{% endcode %}
{% endstep %}

{% step %}
**Start the Enterprise Manager**

1. Go to the Enterprise Manager installation directory
2. Run `docker compose up -d` to start the Enterprise Manager
   {% endstep %}
   {% endstepper %}

<sub>*This page is: Copyright © 2025 MariaDB. All rights reserved.*</sub>

{% @marketo/form formId="4316" %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://mariadb.com/docs/tools/mariadb-enterprise-manager/administration/backup-and-restore-of-enterprise-manager.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
