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

Add scripts and docs to configure docker backups #2534

Open
wants to merge 44 commits into
base: develop
Choose a base branch
from

Conversation

dumbstertruck3
Copy link

@dumbstertruck3 dumbstertruck3 commented Oct 13, 2024

Proposed Changes

  • Added a script for backing up the PSQL database in the docker container
  • Added docs to set up the cronjob in README.md
  • Edited the compose file to mount a local directory to new directory inside the container
  • Added docs to restore the container's database
  • Fixed some typos

Associated Issue

  • Create db backup scripts for instances running on pure docker #2301
  • The backup script works perfectly
  • Mounted a local directory to a new directory(backups) inside the container, so that the user can move the backed up sql file inside this local directory and restore the container's database
  • The backup.md doc will help the user to restore the container's database

Architecture changes

  • Added a new doc
  • Added a new script in /care/scripts
    Only PR's with test cases included and passing lint and test pipelines will be reviewed

@ohcnetwork/care-backend-maintainers @ohcnetwork/care-backend-admins

@dumbstertruck3 dumbstertruck3 requested a review from a team as a code owner October 13, 2024 17:52
Backup.md Outdated Show resolved Hide resolved
Backup.md Outdated Show resolved Hide resolved
Backup.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
docker-compose.yaml Outdated Show resolved Hide resolved
scripts/backup.sh Outdated Show resolved Hide resolved
scripts/backup.sh Outdated Show resolved Hide resolved
scripts/backup.sh Outdated Show resolved Hide resolved
@sainak sainak changed the title Docker backup Add scripts and docs to configure docker backups Oct 14, 2024
.env.example Outdated Show resolved Hide resolved
.env.example Outdated Show resolved Hide resolved
docs/databases/backup.rst Outdated Show resolved Hide resolved
===========================

We are basically deleting the container's existing database and creating a new database with the same name. Then we will use ``pg_restore`` to restore the database. Run the following commands in your terminal.

Copy link
Member

Choose a reason for hiding this comment

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

instruct user to stop all containers except db before proceeding

scripts/backup.sh Outdated Show resolved Hide resolved
@dumbstertruck3
Copy link
Author

I've changed the code and the docs as requested, are there more changes?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants