Mongorestore takes a lot of time, how about just copying the "/ data / db" directory?

In my case, I want to backup and restore all databases. It may sound silly, but -

Instead of doing

# backup
mongodump  # takes time
# restore
mongorestore # takes a lot of time

Why can't I just

# backup
tar -cvzf /backup/mongo.tar.gz /data/db
# restore
tar -xzf /backup/mongo.tar.gz -C /data/db

Does it really not work?

+4
source share
1 answer

In principle, yes, it is possible, but there are a few caveats. Strategies with their respective abbreviations and minuses are discussed in detail in the backup documentation . In essence, replica sets and outlines make the process more complex.

  • , , . , , .

  • /lvm ( ); , , , , . , , LVM, , , , .

  • , , , - "" - ( , ), .

+2

All Articles