Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

create backup and restore section with new images #296

Merged
merged 1 commit into from
Aug 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix grammatical error in the description.

The possessive form "datastore's" should be corrected to "datastores" for proper grammar.

- description: Enable backup and restore for Postgres and Dgraph datastore's
+ description: Enable backup and restore for Postgres and Dgraph datastores
Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
description: Enable backup and restore for Postgres and Dgraph datastore's
description: Enable backup and restore for Postgres and Dgraph datastores

---

# 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)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add missing article in the backup operations step.

Include the article "a" before "file" for grammatical correctness.

- d. Write the data to file (JSON)
+ d. Write the data to a file (JSON)
Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
d. Write the data to file (JSON)
d. Write the data to a file (JSON)
Tools
LanguageTool

[uncategorized] ~23-~23: You might be missing the article “a” here.
Context: ... of interactions \ d. Write the data to file (JSON) ## Backup Dgraph and Postgres P...

(AI_EN_LECTOR_MISSING_DETERMINER_A)


## 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)