If the mongod process crashes (that is, without crashing or kill -9 ), then data files can be copied somewhere.
If your current installation breaks down (for example, data corruption due to unclean shutdown), you can delete its files, copy this backup and run mongod again.
The default data directory is /data/db , but a different value may be set in your configuration file. For example, I installed it in /var/lib/mongodb .
You can also use mongodump to back up from a live server (this may affect performance). Use mongorestore to restore backups made with mongodump .
source share