Skip to content

New plugin MongoDb#68

Merged
marcpope merged 1 commit intomarcpope:mainfrom
sainf:main
Mar 30, 2026
Merged

New plugin MongoDb#68
marcpope merged 1 commit intomarcpope:mainfrom
sainf:main

Conversation

@sainf
Copy link
Copy Markdown
Contributor

@sainf sainf commented Mar 30, 2026

Summary

Love you software, but i also love MongoDb, so me and my friend Claude, created and tested the this new plugin.

This pull request adds comprehensive support for MongoDB backup and restore operations to the system. It introduces a new mongo_dump plugin that uses mongodump for backups and mongorestore for restores, integrates MongoDB into the backup/restore workflow and UI, and updates both backend and database schema to support this new functionality.

MongoDB Backup/Restore Plugin and Workflow Integration:

  • Added a new mongo_dump plugin for MongoDB database backups using mongodump, with support for per-database dumps, gzip compression, and automatic cleanup. The plugin is registered in both the migration (070_mongo_dump_plugin.sql) and schema (schema.sql). [1] [2]
  • Implemented backup logic in execute_plugin_mongo_dump, including database discovery, authentication, and error handling. Added cleanup and connectivity test functions.
  • Added MongoDB restore support via a new restore_mongo task type, with corresponding logic in execute_restore_mongo to extract and restore database dumps using mongorestore. [1] [2]
  • Integrated MongoDB backup and restore into the agent's task execution flow, including reporting backed-up databases and updating the UI to handle MongoDB-specific grant instructions and restore actions. [1] [2] [3]

Database and Metadata Updates:

  • Updated the plugins and backup_jobs schema to include the mongo_dump plugin and new restore_mongo task type, ensuring MongoDB jobs are tracked and categorized correctly. [1] [2] [3] [4]

Other Improvements:

  • Added display name and summary reporting for the new MongoDB plugin in the agent. [1] [2]
  • Bumped agent version to 2.20.0.

Testing

  • Tested on Docker
  • Tested on bare metal
  • Agent changes tested on Linux
  • Agent changes tested on Windows

@sainf
Copy link
Copy Markdown
Contributor Author

sainf commented Mar 30, 2026

Also generated the Wiki Plugins / Database help text: Gist

marcpope added a commit that referenced this pull request Mar 30, 2026
Adds MongoDB backup/restore plugin (mongo_dump) and fixes restore
performance and safety across MySQL, PostgreSQL, and MongoDB:
- Extract only requested database files (not entire dump directory)
- Safety backup before replace restores
- Accurate job timing via immediate progress reporting
@marcpope marcpope merged commit cd22b95 into marcpope:main Mar 30, 2026
@marcpope
Copy link
Copy Markdown
Owner

Merged! Thank you for the great contribution. We applied a few additional fixes on top of your code:

Fixes applied:

  1. Targeted extract for MongoDB restoreborg extract now targets specific dump_dir/dbname/ directories instead of the entire dump directory. Dramatically speeds up restores on large archives.
  2. Safety backup before replace restore — Before --droping a MongoDB database, the agent dumps the current version to dump_dir/_pre_restore/dbname/ as a safety net.
  3. Accurate job timing — Agent reports running status immediately at restore start, so Started At and Duration are accurate.
  4. Fixed PluginManager constructorrestoreMongoSubmit() was missing $this->db parameter.
  5. Agent version aligned to current release.

Bonus: Also fixed the same issues for PostgreSQL restore — targeted extract, safety backup, and progress reporting were missing there too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants