- 
                Notifications
    
You must be signed in to change notification settings  - Fork 380
 
Documentation for the database backups and restore of sunbird medium scale deployments
        santhosh-optit edited this page Feb 23, 2018 
        ·
        1 revision
      
    - 
ssh to db-server.
 - 
git clone
https://github.com/project-sunbird/sunbird-devops - 
cd sunbird-devops/deploy/ - 
You can find backup and restore scripts.
 
- Take snapshot of cassandara db
 
nodetool snapshot -t my_backup
- 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)
- restore cassandra database
 
./cassandra_restore.py --cassandra_host ip_address --snapshotdir /backups/cassandra/$(date +%Y-%m-%d)
- For the postgres backup .
 
./backup_postgres.sh
2.Copy the backup file from the /tmp/postgresql-backup/<backup_file>
- Restore postgres database
 
psql -f <backup_file>  postgres
- For the Elasticsearch backup.
 
./backup_elasticsearch.sh
- Copy the backup file, Restore Elasticsearch
 
./restore_elasticsearch.sh <restore_file>