Restore mongodb_backup

Introduction

Restoring a backup that was previously created via the 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.

Establish a connection into the mongobackup container
# 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:

# Create a backup
./backup.sh