# Restore mongodb\_backup

### **Introduction**

Restoring a backup that was previously created via the [Preferences - Backup and Restore](https://docs.helmut.de/helmut4-releases/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://content.gitbook.com/content/cJYkTyk9qgh7aCR6dHIm/blobs/bEYN57p1lZcotgGofnkl/image.png" 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
```
