Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

248
Views
Downloading a Bson Collection with mongodmp in mongocompass and kubernetes Databank

I am trying to backup a database from a kubernetes cluster to my computer as a bson file. I have connected my mongodb compass to the kubernetes cluster using port-forwarding. Can anyone help me with the command I need to download a particular Collection (450gb) from a databank to my desktop?

I've been trying for a while now but I cant seem to find the way around it.

In mongocompass there is unfortunately no way to download a collection as a bson file. The port I have forwarded the kubernetes pod to is 27017.

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

From the mongodb official docs:

Run mongodump from the system command line, not the mongo shell.

So, assuming you configured Kubernetes Port Forwarding on your local machine like this:

$ kubectl port-forward service/mongo 28015:27017

And you've got output similar to this:

Forwarding from 127.0.0.1:28015 -> 27017
Forwarding from [::1]:28015 -> 27017

You can now export data from mongodb using the following command:

$ mongodump --username root --port=28015 -p secretpassword

This will create a dump directory in the current working directory and export data there.

Also, to export only specific collection use the following option:

--collection=<collection>, -c=<collection>

Specifies a collection to backup. If you do not specify a collection, this option copies all collections in the specified database or instance to the dump files.

You can check other available option here.

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!