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

226
Views
MongoDb 2.6 issue with archiving

good day, i stuck with script which is made to backup a collection of mongodb, 2.6 version doesn't support --gzip suffix, is there a way how to use other way to archive collections and in case of need safely to do mongorestore? Thanks a lot for a reading my post.

#specify collections
collection_list="students loans.lib help.archive"
#if its running on local machine:
host="127.0.0.1"
port="27208"
#where to dump:
out_prefix="/apps/mongodb/uni/backup/mongodump"
for collection in $collection_list; do
        echo $collection
        out_dir="${out_prefix}/${db}_${collection}.$(date +%Y.%m.%d)/"
        mkdir -p ${out_dir}
        /apps/mongodb/server/2.6.2/bin/mongodump -u  -p --host $host --port $port -d $db --collection $collection --out ${out_dir}
done

--gzip is not recognized :( P.S. I'm not able to upgrade our old university mongodb, we dont have a budget for it.

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

If you need to compress on the fly without the "--gzip" option introduced in mongodb 3.2 , you can do as follow in linux:

 mongodump -d yourDB -c yourCOL -o - | gzip > yourDByourCOLdump.gz

to restore it , you can do:

 gunzip yourDByourCOLdump.gz
 mv yourDByourCOLdump yourDByourCOLdump.bson
 mongorestore -d yourDB -c yourCOL yourDByourCOLdump.bson
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!