cjlee112 / spnet

selected papers network web engine
http://thinking.bioinformatics.ucla.edu/2011/07/02/open-peer-review-by-a-selected-papers-network/
GNU General Public License v2.0
40 stars 11 forks source link

establish database backup process #43

Open cjlee112 opened 11 years ago

cjlee112 commented 11 years ago

First note that most spnet data are (also) stored in Google+, so in principle even if we deleted our mongoDB database, only a few "private data" types would be gone forever:

(Everything else could be recovered by one #spnetwork query). All the same, we need to set up a backup process, to protect against data loss in case something bad happens to our webfaction server:

cjlee112 commented 11 years ago

OK, I performed basic backup procedure from webapps/mongodb directory:

mongodb-linux-x86_64-2.4.1/bin/mongodump --port 26966 --username backup --db spnet --password
tar cvzf dump.tgz dump

I then scp'd the dump.tgz file (18 MB) to a safe location.

Note this first required creating backup user in the spnet db:

mongodb-linux-x86_64-2.4.1/bin/mongo --port 26966 admin
> db.auth('admin', PASSWORD)
> use spnet
> db.addUser( { user: "backup", roles: ["readWrite", "dbAdmin", "userAdmin"], pwd: PASSWORD } )