You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Next »

BioHPC database

Where is the DB hosted

Our BioHPC database is hosted on cbsujohnson.biohpc.cornell.edu. Once you created a BioHPC account, you can ssh to the machine using

ssh <your NetID>@cbsujohnson.biohpc.cornell.edu

Then, if you run docker1 ps, you can see the Docker container of our database

This container is created and run by Zack, one of our previous team members, and the script he used is located at /workdir/ztb5/mongo/.

How to backup/restore the DB

Currently, the backup is done by a Cron job that executes the script /home/ts864/mongoDbBackup/dumpJob.sh at 4:00 AM every day. The content of the script is provided below

# Scheduled to run daily at 4am.
# Captures and stores the current state of the database.
mongodump --uri="mongodb://mongodbuser:2TQFTnrQYb2yQFhYqnCUGxesurPISnXwhsFHyfP2cr4ILQeUk1@cbsujohnson.biohpc.cornell.edu:8001/?authSource=admin&readPreference=primary&appname=MongoDB%20Compass&ssl=false" \
          -o=/home/ts864/mongoDbBackup/dumpData/dump-$(date +%Y-%m-%d)

# Deletes backups created more than and including 7 days ago.
find /home/ts864/mongoDbBackup/dumpData/dump-* -mtime +7 -delete

It is scheduled using command crontab -e. The backups are stored in a /home directory because BioHPC automatically backups home directories nightly.


To restore the backups to a target DB, run the following command

mongorestore --uri=<target DB URI> --drop path-to-backup-folder/
  • No labels