Skip to content

Backing Up and Restoring MHN

Jason Trost edited this page Nov 22, 2015 · 2 revisions

Warning, this has not been throughly tested. Do not rely on this until you have tested it yourself. Feedback welcome.

Back up

On the MHN Server

sudo su -
supervisorctl stop all
mongodump  --db hpfeeds
mongodump  --db mnemosyne
tar zcvf mhn-backup.tar.gz dump /opt/mhn/server/mhn.db
supervisorctl start all

Copy mhn-backup.tar.gz somewhere safe.

Restore

Install MHN using the install.sh mentioned in the main README.

Then, copy the mhn-backup.tar.gz to /tmp/ and run the following:

sudo su -
supervisorctl stop all
cd /tmp
tar zxvf mhn-backup.tar.gz
cp opt/mhn/server/mhn.db /opt/mhn/server/mhn.db

service mongod start
for FILE in dump/mnemosyne/*.bson;
do 
    mongorestore --drop --db mnemosyne "$FILE"
done

for FILE in dump/hpfeeds/*.bson;
do 
    mongorestore --drop --db hpfeeds "$FILE"
done

supervisorctl start all