Browse articles

Database backup

# How to back up MongoDB automatically with incremental oplog

Scheduled MongoDB backups with mongodump and oplog-based incrementals: replica set requirement, mongosh, restore with oplogReplay, and optional encryption.

1 min readUpdated: October 22, 2026[Baca dalam Bahasa Indonesia](/docs/backup-mongodb)

The agent runs `mongodump` on a schedule to object storage. Incremental mode reads the oplog between two timestamps, so only changes are stored; this requires MongoDB to run as a replica set.

## 1\. Prepare the server

Make sure `mongodump` and `mongorestore` (MongoDB Database Tools) are on the PATH. For incremental backups: MongoDB must be a replica set and `mongosh` must be installed. Incremental restores use `mongorestore --oplogReplay` and can only target the same database name.

## 2\. Install the agent

Dashboard → **Servers → Add server**, then run the command shown on the server as root.

```bash
curl -fsSL https://linuxteknosia.cloud/install.sh | sudo bash -s -- --server https://linuxteknosia.cloud --token <token from the dashboard>
```

## 3\. Connection and job

Add a MongoDB connection (host, user, password, database), then create a job with the wizard in **Full + incremental** mode. An incremental with no changes produces a successful run without a new artifact.

## 4\. Restore

Open the run under **History → Restore**. The agent restores the base full backup and then replays the incremental oplog up to the selected point.

## See also

-   [How to back up MySQL / MariaDB automatically with Linuxteknosia Cloud](/docs/backup-mysql)
-   [How to back up PostgreSQL automatically with Linuxteknosia Cloud](/docs/backup-postgresql)
-   [How to use the AWS CLI with Linuxteknosia Cloud](/docs/aws-cli)

Still need help?

Open a support ticket from the dashboard and our team will reply as soon as possible.

[Help center](/en/help)[Open a ticket](/app/support/new)