Skip to content

Commit

Permalink
updated back backup and restore
Browse files Browse the repository at this point in the history
  • Loading branch information
NyashaMuusha committed Sep 9, 2024
1 parent e77f1c7 commit f1bf7d6
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions documentation/backup-and-restore.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,23 @@ b. Get the list of Golden Record Source Ids \
c. Get the list of interactions \
d. Write the data to file (JSON)

## Prerequisites
- PostgreSQL Version: Ensure that PostgreSQL 15.5.0 is installed.
- The backup and restore operations are validated on this version.
Verify the installation by running psql --version

**Python Installation**
- Make sure Python and the python-dotenv package are installed to manage environment variables.
- Verify the installation by running python3 -m dotenv --version

**Using python-dotenv**
Load these variables using python-dotenv:
- from dotenv import load_dotenv
- import os
- load_dotenv(/path/to/your/.env)
- print(os.getenv(environment variable name))
- python3 test_dotenv.py (This should load the environment variables from your .env.local file)

## Backup Dgraph and Postgres Process
- **Backup Directory Dgraph:** \
JeMPI/devops/linux/docker/docker_data/data/backups/dgraph
Expand All @@ -44,6 +61,14 @@ The backup process creates a folder with a timestamp. Inside this folder, backup

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

**Manual Backup Process**

- pg_dump -U <username> -d <database_name> > /path/to/backup_file.sql

**Verify if process was successful**
- echo $? (This variable holds the exit status of the last command executed. An exit status of 0 indicates that the last command (pg_dump) completed successfully.)
- ls -lh

## Restore Dgraph and Postgres Process

- **Backup Directory:** JeMPI/devops/linux/docker/docker_data/data/backups/dgraph
Expand Down

0 comments on commit f1bf7d6

Please sign in to comment.