Database Backup & Restore
Export and restore selected Payload CMS MongoDB collections as portable JSON from the admin panel.
Installation
pnpm add @yairl/payload-db-backup-restore About
This plugin adds a backup and restore screen to a Payload 3 admin panel. Pick the collections you want from a checklist, hit download, and you get a single JSON file with every document in those collections. Restore reads that file back and reinserts the rows. The whole thing mounts at `/admin/backup` and adds a sidebar shortcut by default. The file is written with EJSON, so MongoDB types like `ObjectId`, `Date`, and `Decimal128` round-trip byte for byte rather than degrading into plain strings. When a collection has drafts enabled, its `_<slug>_versions` sidecar is exported and restored alongside the main slug automatically. Restore uses raw Mongoose `insertMany`, not `payload.create`. That is deliberate: Payload hooks such as `beforeChange` and `afterChange` do not fire, so a bulk restore will not re-run title setters or trigger thousands of revalidation calls. The `_id` of each document is preserved exactly as it was in the backup. There is a "drop before restore" option, on by default, that empties the target collection first; turn it off and `insertMany` runs with `ordered: false`, so duplicate `_id` rows error individually while the rest succeed. It is MongoDB only. The code reaches into `req.payload.db.collections` and `db.versions`, and the Postgres and SQLite adapters do not expose the same shape. It also does not cover uploaded blob files on disk, global admin settings, or Payload's internal system collections. Access defaults to a `req.user.roles.includes('admin')` check, which you will likely want to override to `req => !!req.user` unless you have added a `roles` field to your Users collection. Three REST endpoints sit behind that same check if you want to script backups from outside the admin UI.
Package info
- Package name
@yairl/payload-db-backup-restore- Latest version
0.1.0- Unpacked size
- 51 kB
- License
- MIT
- Weekly downloads
- 45
- Last publish
- Jul 4, 2026
Similar plugins
More in AdminDashboard Analytics
Adds Plausible and Google Analytics widgets to the Payload admin dashboard, navigation, collections and globals.
AI Completions
Payload plugin that generates field content through OpenAI chat completions from the admin panel.
Default Roles
Applies default role-based access control to every Payload collection, granting CRUD access to specified roles such as admin and executive.
Warding
RBAC plugin that generates user and role collections and injects fine-grained access control across Payload collections, globals, fields, and endpoints.
Iframe Tabs
Add iframes into separate tabs in the Payload admin panel.
Visual Editor
Adds a visual live editor to Payload CMS for instant content preview.