I am trying to duplicate a database called database_A
in the same cluster.
The result should be a new database called database_B
with the exact same data.
I am trying to follow the instructions here.
It explains how to do this locally:
- Use mongodump to dump the test database to an archive mongodump-test-db:
mongodump --archive="mongodump-test-db" --db=test
- Use mongorestore with --nsFrom and --nsTo to restore (with database name change) from the archive:
mongorestore --archive="mongodump-test-db" --nsFrom='test.' --nsTo='examples.'
In order to achieve the same result in the cluster, it says:
Include additional options as necessary, such as to specify the uri or host, username, password and authentication database.
However, when I try to add the uri
to achieve the first step:
mongodump --uri mongodb+srv://hihi:[email protected] --archive="mongodump-test-db" --db=test_db
I get this error:
illegal argument combination: cannot specify --db and --uri
Any idea how to solve this?