mongodbdatabase-backupsmongodumpopenbsd

mongodump can't connect, how can I dump my mongodb dump without using mongodump


I have mongo 3.2.13 installed on OpenBSD 6.4. Mongo is installed via packages (pkg_add mongodb). The installation doesn't include mongodump, so I have to install it via the mongo-tools repo

mongodump can't detect any servers:

./bin/mongodump --verbose --port=27017 --host=127.0.0.1
2019-01-04T00:57:11.552-0800    Failed: error connecting to db server: no reachable servers

but mongod is running and I can connect:

mongo --verbose --port=27017 --host=127.0.0.1
MongoDB shell version: 3.2.13
connecting to: 127.0.0.1:27017/test
2019-01-04T01:02:58.148-0800 D NETWORK  [thread1] creating new connection to:127.0.0.1:27017
2019-01-04T01:02:58.149-0800 D NETWORK  [thread1] connected to server 127.0.0.1:27017 (127.0.0.1)
2019-01-04T01:02:58.149-0800 D NETWORK  [thread1] connected connection!

I'm really only interested in one database which has about 25 collections. What series of commands could I use to back up this database (even if the commands have to be glued together with bash, node, ruby, etc)?

Edit: add mongo and mongdump version

mongo --version
MongoDB shell version: 3.2.13

./bin/mongodump --version
mongodump version: built-without-version-string
git version: built-without-git-spec
Go version: go1.11
   os: openbsd
   arch: amd64
   compiler: gc

git log|head
commit 0c07b518aacdca382fc931a7946811cf16e46a78
Author: Ted Tuckman <ted.tuckman@mongodb.com>
Date:   Thu Dec 20 16:19:20 2018 -0500

    TOOLS-2109 Upgrade to go 1.11 in build script

commit 6dda8ce1473bfced00c4eff190918f29874d24bd
Author: Ted Tuckman <ted.tuckman@mongodb.com>
Date:   Wed Dec 12 10:11:06 2018 -0500

Currently mongodump is built from origin/HEAD. I'll try checking out the 3.2 branch and rebuilding


Solution

  • Make sure you have compiled a compatible version of mongodump, see

    mongodump --version
    
    mongo --version