# Restore mongodb\_backup

### **Introduction**

Restoring a backup that was previously created via the [Preferences - Backup and Restore](https://docs.helmut.de/helmut4-releases/v4.9.1/helmut4-components/helmutfx/preferences#backup-and-restore) tab is the easiest option during a recovery or emergency situation.

### **Prerequisites**

If no manual backup exists, you can restore the most recent automatic backup created by the **mongobackup** container. Note that the container must be properly set up in advance. For further information, refer to *Define mongo\_db backup volume*.

### **Restoring a Backup**

1. Navigate to Portainer and select the **mongobackup** container in the **Containers** tab.
2. Establish a bash connection to the container and run the necessary commands.

<figure><img src="https://3891896678-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FAA4Fo3OZKLqkDi9lfW7u%2Fuploads%2FkfiYpHHxLMJifqrHwRmW%2Fimage.png?alt=media&#x26;token=6f8eabc9-6aa7-48c5-90dc-024c1b740da1" alt=""><figcaption><p>Establish a connection into the mongobackup container</p></figcaption></figure>

```bash
# List all available backups
ls /backup

# Restore a backup
./restore.sh /backup/2025-02-12-103029
```

### Creating a Backup

To create a manual backup, you have two simple options:

1. **Restart the mongobackup container:** A backup is automatically created each time the container starts successfully.
2. **Execute the backup script:** Establish a bash connection to the container and run the following command:

```bash
# Create a backup
./backup.sh
```
