Add mongodb dump hook #483
No reviewers
Labels
No Label
bug
data loss
design finalized
good first issue
new feature area
question / support
security
waiting for response
No Milestone
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: borgmatic-collective/borgmatic#483
Loading…
Reference in New Issue
No description provided.
Delete Branch "sanzoghenzo/borgmatic:mongodb_hook"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Merry Christmas!
For the holydays I tried to solve issue #288 with this MR.
I was in a hurry and only tested with a single database and basic authentication (username and password).
I just copied and adapted the postgresql unit tests, and they all pass.
This looks awesome! Thank you so much for taking the time to implement MongoDB support.
It appears that there is one test failing however, at least in CI: https://build.torsion.org/borgmatic-collective/borgmatic/111/1/4
Specifically, it's the
test_database_dump_and_restore_with_directory_format
test. You should be able to reproduce this locally withscripts/run-full-dev-tests
, assuming you have Docker and Compose available locally.The error in question is
/bin/sh: mongodump: not found
, which to me suggests that you just need the MongoDB client installed in the test image. The place to do that would be inscripts/run-full-tests
. You might be able to just addmongodb-tools
to the firstapk add
line.Additionally, you'll probably need to add a MongoDB server image to
tests/end-to-end/docker-compose.yaml
and.drone.yml
so that a MongoDB server is available both for local tests and CI tests (respectively).Let me know if you need any help with this!
@ -776,0 +813,4 @@
example: trustsome1
format:
type: string
enum: ['archive', 'directory']
This doesn't mention
custom
as one of the options, but it looks like the default iscustom
below. Should it be here too?@ -776,0 +817,4 @@
description: |
Database dump output format. One of "archive",
or "directory". Defaults to "archive" (unlike
raw pg_dump). See pg_dump documentation for
This references
pg_dump
. Should it refer to something Mongo-specific instead?Sorry for not running the integration test sooner!
I fixed it, and added the "auth_db" option to specify a diffrerent authentication database than the one to be exported.
There are plenty of other options that I didn't expose (different auth mechanisms, ssl certs and so on) because I don't use them (yet), but for now one can simply use the "options" item.
Thanks, this is great! Looks like the continuous integration is failing on some versions of Alpine but not others. What I've done is drop support for Python 3.6 (and the corresponding version of Alpine) in master, so that eliminates one failure. And then I've also dropped the Python 3.7 build just because (as that version of Alpine doesn't even include a Mongo client). So I think your build should pass once all that's merged in.
Sorry, I realized that I needed to merge your upstream changes to my branch!
It works now!
Cool.. Thank you! Heads up that I might rename the new
auth_db
option for consistency with some of the other options prior to release.Just released in borgmatic 1.5.22! FYI I did end up renaming
auth_db
toauthentication_database
.