MongoDB Backup

Adds MongoDB backup and restore to Payload v3 with Vercel Blob Storage, scheduled retention, and a native admin dashboard.

Community 5 288/wk MIT v0.1.7

Installation

pnpm add @trieb.work/payload-plugin-backup-mongodb

About

This plugin adds MongoDB backup and restore to a Payload v3 project that uses the mongoose adapter. Backups are stored as archives in Vercel Blob Storage, and a fresh install can list and restore any prior archive without first bootstrapping a database, because each blob name encodes the type, database, host, collection count, and timestamp. It works with MongoDB only. The plugin registers a `BackupDashboard` widget through the Payload admin `afterDashboard` slot and a set of custom REST endpoints under `/api/backup-mongodb/*`, so no Next.js route files are required. Backups cover every MongoDB collection, including hidden system collections such as `users`, `payload-preferences`, and `payload-migrations`, and individual collections can be excluded per run from the UI or API. Media blobs can be bundled into the archive as a `.tar.gz` alongside the dump. Scheduled backups run through an HTTP cron endpoint that you wire to Vercel Cron or any scheduler, with a configurable retention count that prunes older archives. Manual backups and restores are tracked in a hidden `backup-tasks` collection with a 30-minute TTL, and the dashboard polls progress with a short-lived secret so long jobs stay observable across reloads. Restore supports a collection blacklist and a `mergeData` upsert mode for partial restores. Configuration is light: the plugin reads `MONGODB_URI`, `BLOB_READ_WRITE_TOKEN`, and optionally `CRON_SECRET`, `BACKUPS_TO_KEEP`, and `PAYLOAD_BACKUP_ALLOWED_ROLES` for dashboard access control. It peers against Payload 3, `@payloadcms/db-mongodb`, Next.js 15, and React 19. An `access` plugin option and an optional `seedDemoDumpUrl` are available, but the storage backend is limited to Vercel Blob.

Package info

Package name
@trieb.work/payload-plugin-backup-mongodb
Latest version
0.1.7
Unpacked size
784 kB
License
MIT
Weekly downloads
288
Last publish
May 4, 2026

More from trieb-work

View profile

Similar plugins

More in Admin