AG_HIHI
AG_HIHI

Reputation: 1995

Mongodump: Error parsing command line: unrecognised option '--uri'

I am trying to achieve a database dump using this command:

mongodump --uri mongodb+srv://ACC_NAME:[email protected]/DATABASE_NAME

But, I keep getting this error:

Error parsing command line: unrecognised option '--uri'


CONTEXT:

I have done this several times before on my local machine. And now I am attempting to do this on a VPS where I am installing mongodb from scratch.

I tried installing it following the official documentation until I reached this step:

sudo apt-get install -y mongodb-org

Which throws this error:

E: Unable to locate package mongodb-org

After doing some research, I have found this stackoverflow question where most answers say that I should just:

At first try with this command: sudo apt-get install -y mongodb

This is the unofficial mongodb package provided by Ubuntu and it is not maintained by MongoDB and conflict with MongoDB’s offically supported packages.

So I did exactly that, and the rest is what I explained earlier in this post.


mongo --version
MongoDB shell version: 2.6.10

mongod --version
db version v2.6.10

hostnamectl
Operating System: Ubuntu 16.04.7 LTS
Kernel: Linux 4.4.0-210-generic
Architecture: x86-64

Upvotes: 2

Views: 972

Answers (1)

heinels
heinels

Reputation: 187

I got the same error as well when I was trying to archive the data with mingo.

command executed from mingo

 mongodb-database-tools-macos-x86_64-100.7.5/bin/mongodump --uri="mongodb://xxx:@host:8001/db?appName=mingo",--archive="<any_path>",--db="Billing",--gzip,--forceTableScan

As I check my CPU architecture, I found I use the incorrect mongodb tool. The tool site suggest me to download ARM64 version. But I should use X86 version. After change the correct tool package, everything is fine.

  Darwin CNL-C02FQ094ML87 22.5.0 Darwin Kernel Version 22.5.0: Thu Jun  8 22:22:22 PDT 2023; root:xnu-8796.121.3~7/RELEASE_X86_64 x86_64

enter image description here

Upvotes: 0

Related Questions