Hi MongoDB Community,
I’m seeking help in understanding why my MongoDB database was unexpectedly deleted from my Ubuntu server hosted on DigitalOcean.
Environment Details:
- MongoDB Version: 8.0
- OS: Ubuntu 22.04 LTS
- Hosting: DigitalOcean Droplet
- MongoDB Data Path: /var/lib/mongodb (default)
Issue Summary:
Recently, I discovered that my entire MongoDB database was deleted or missing from the server. The droplet itself is still accessible via SSH, but the MongoDB data appears to be completely gone.
There were no explicit commands issued to delete the database, and I have not configured any scripts that might clear out the data.
Symptoms:
- The
/var/lib/mongodbdirectory is empty or missing. - MongoDB service was not running when I checked.
- No recent backups are available.
- No known users had access to manually delete the data.
What I’m Looking For:
- What possible scenarios or events could result in the MongoDB data directory being wiped or deleted?
- Could a crash, forced restart, or system update on DigitalOcean cause this?
- Are there specific MongoDB or system logs I should check to investigate further?
- Any guidance on how to prevent this in the future — backup strategies, system alerts, or MongoDB best practices?
Additional Notes:
- I have reviewed
/var/log/mongodb/mongod.logbut didn’t find any obvious cause (I can share logs if needed). - I can also check
journalctlor other system logs if there are specific commands you’d suggest.
Any help or suggestions would be greatly appreciated!
Thank you.