Search code examples
mongodbmongodb-query

Archive replica set in mongodb


Friends, I'm a MongoDB DBA and I'm totally new to Mongo and also to DBA role.

I want to archive data that is one month old in a 3 node replica set. mongodump is one option I can achieve this but my client asks me if there are any options. So please could you suggest the available options for archiving the data in replica set.

Many thanks!!!


Solution

  • Yes, we have multiple options.

    We can able to take from tools like,

    1. OPS Manager
    2. Atlas
    3. Scripting via

    Other than that, if you are trying in manually use MongoDUMP

    mongodump --archive=test.20150715.gz --gzip --db test

    or

    mongodump --gzip --db test

    EXTRA if you want to restore same archive file,

    mongorestore --archive --port 27017 --host abc.mongo.com

    Refer: https://docs.mongodb.com/manual/reference/program/mongodump/ https://docs.mongodb.com/manual/reference/program/mongorestore/