Backup and Restor Mongodb - Methods

1

I'm starting on mongodb, linux platform. I would like to know the best backup strategy since:

Date import and Export - are used for cvs or json outputs  Mongodump and Mongorestore - are used for small bases.

Anyway, what's the best tool?

    
asked by anonymous 17.07.2017 / 22:36

1 answer

0

The official documentation page mentions several ways. Disregarding the official maintenance tool, the Cloud Manager that is paid per server, you have two options (three depending on operating system / infrastructure):

  • Use mongodump / mongorestore.
  • Copy the files manually.
  • Use snapshot of the disk where your data is (and journal).
  • Dump / restore works fine only on a small footprint because the complexity that is added when you have multiple shards, for example, makes integrity management / syncing of backups impractical.

    If you are running a replication set (replica set), I see no problem backing up with dump / restore. Whereas you use the --oplog option so that changes that are being made during the dump are included, and then in restore use --oplogReplay.

    Copying files manually involves stopping any writing on the server (s) because you are copying multiple files, and this is not an atomic operation.

    In the case of snapshots you can use without problems since journaling is active (it is the default), without which there is no guarantee that your snapshot will be valid. If you use this option on a sharded cluster, you need to stop the balancer and snapshot all shards and configuration servers at the same time.

        
    24.07.2017 / 05:15