Skip to content

Documentation for the database backups and restore of sunbird medium scale deployments

santhosh-optit edited this page Feb 23, 2018 · 1 revision

Initial Steps

  1. ssh to db-server.

  2. git clone https://github.com/project-sunbird/sunbird-devops

  3. cd sunbird-devops/deploy/

  4. You can find backup and restore scripts.

Cassandra

  1. Take snapshot of cassandara db

nodetool snapshot -t my_backup

  1. copying the snapshot to your backup directory

./cassandra_backup.py --datadir /var/lib/cassandra/data
--snapshotname my_backup
--targetdir /backups/cassandra/$(date +%Y-%m-%d)

  1. restore cassandra database

./cassandra_restore.py --cassandra_host ip_address --snapshotdir /backups/cassandra/$(date +%Y-%m-%d)

Postgres

  1. For the postgres backup .

./backup_postgres.sh

2.Copy the backup file from the /tmp/postgresql-backup/<backup_file>

  1. Restore postgres database

psql -f <backup_file> postgres

Elasticsearch

  1. For the Elasticsearch backup.

./backup_elasticsearch.sh

  1. Copy the backup file, Restore Elasticsearch

./restore_elasticsearch.sh <restore_file>

Clone this wiki locally