Skip to content
This repository has been archived by the owner on Aug 11, 2021. It is now read-only.

Data Backup and Restore

Sri Maurya Kummamuru edited this page Jan 20, 2021 · 2 revisions
Warning: This page is going to be retired and this documentation will be maintained at - https://github.com/OpenConceptLab/ocl-docs/

Schedule weekly MongoDB backups

A cron job has been setup to take backup for MongoDB which runs at midnight every Sunday.

In order to list the cronjobs on staging and production environments:

  • ssh to the box
  • crontab -l -- list jobs
  • crontab -e -- Edit job

Taking a backup manually on demand

Run the following command to create backup

oclapi/django-nonrel/ocl/deploy/mongo_backup.sh

Backups are timestamped tar files stored under /home/root/backups.

Restoring from backup

In order to restore data from a backup

  1. SSH into the environment
  2. Run ~/oclapi/django-nonrel/ocl/deploy/mongo_restore <backup_file_location>
  3. Rebuild Solr index using:
yes | docker exec -i ocl_api python manage.py rebuild_index -k 5
Clone this wiki locally