Skip to content

Commit

Permalink
Merge pull request #296 from jembi/CU-86bzwgcfu_Create-Backup-and-Res…
Browse files Browse the repository at this point in the history
…tore-section

create backup and restore section with new images
  • Loading branch information
MatthewErispe authored Aug 8, 2024
2 parents 4bd660b + 501185d commit a9764e9
Show file tree
Hide file tree
Showing 4 changed files with 65 additions and 0 deletions.
Binary file added documentation/.gitbook/assets/14
Binary file not shown.
Binary file added documentation/.gitbook/assets/15
Binary file not shown.
1 change: 1 addition & 0 deletions documentation/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@
* [Jembi Platform Installation](installation/jembi-platform-installation.md)
* [API](api.md)
* [Single Sign-On](sso.md)
* [Backup and Restore](backup-and-restore.md)
64 changes: 64 additions & 0 deletions documentation/backup-and-restore.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
---
description: Enable backup and restore for Postgres and Dgraph datastore's
---

# Backup and Restore

## Overview
This Functionality provides detailed instructions on how to perform backup and restore operations using the JeMPI_BackupRestoreAPI.

This is a dedicated application for handling both backup and restore operations. The scripts included in this application cover:
- Backup Dgraph using API and dump JSON file.
- Backup Postgres using SQL-Dump
- Restore Dgraph using API using JSON file.
- Restore Postgres using SQL-Dump

## Backup Operations
1. Dump sql files for Postgresql.
2. Get all GoldenIds
3. For each GoldenId: \
a. Retrieve the golden record \
b. Get the list of Golden Record Source Ids \
c. Get the list of interactions \
d. Write the data to file (JSON)

## Backup Dgraph and Postgres Process
- **Backup Directory Dgraph:** \
JeMPI/devops/linux/docker/docker_data/data/backups/dgraph
- **Backup Directory Postgres:** \
JeMPI/devops/linux/docker/docker_data/data/backups/postgres
- **Deployment File:** local-deployment.sh
```bash
cd JeMPI/devops/linux/docker/deployment
./local-deployment.sh
Select Option 5: Backup Postgres & Dgraph
```
- **Backup Script Path:** \
JeMPI/devops/linux/docker/backup_restore/dgraph-backup-api.sh
- **Backup Script Logic Dgraph:** \
JeMPI/devops/linux/docker/backup_restore/dgraph-backup-api.py
- **Backup Script Logic Postgres:** \
JeMPI/devops/linux/docker/backup_restore/postgres-backup.sh

The backup process creates a folder with a timestamp. Inside this folder, backups are created for each Dgraph and Postgres.

![Backup Postgres and Dgraph](../.gitbook/assets/14)

## Restore Dgraph and Postgres Process

- **Backup Directory:** JeMPI/devops/linux/docker/docker_data/data/backups/dgraph
- **Deployment File:** local-deployment.sh

```bash
cd JeMPI/devops/linux/docker/deployment
./local-deployment.sh
Select Option 6: Restore Postgres & Dgraph
```

- It will prompt for confirmation (yes/no) and list the recent 5 backup folders.
- **Enter the backup folder name** - it will start the restoration from the selected backup file.
- **Backup Directory Dgraph:** JeMPI/devops/linux/docker/docker_data/data/backups/dgraph
- **Backup Directory Postgres:** JeMPI/devops/linux/docker/docker_data/data/backups/postgres
- **Manual Backup Run Script:** ./restore-dgraph-postgres.sh {{ Folder_Name }}

![Restore Postgres and Dgraph](../.gitbook/assets/15)

0 comments on commit a9764e9

Please sign in to comment.