# Backup & Restore of Enterprise Manager

## 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

{% 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: 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:

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

The question should be specific, self-contained, and written in natural language.
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.
