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 support for backup and restore using docker #521

Merged
merged 27 commits into from
Oct 14, 2024

Conversation

moustaphacheikh
Copy link
Collaborator

No description provided.

@vildead
Copy link
Member

vildead commented Sep 24, 2024

I still need to go through the README.md and DEPLOYMENT.md to avoid overlap with /doc folder.

- move old deployemnet and administration steps to legacy doc
- split tasks into several manuals (deployment, backup, development,
  etc.)
- update README file
doc/backup.md Show resolved Hide resolved

Replace `/path/to/backup_script.sh` with the actual path to backup_script.

### Restore Legacy Backup
Copy link
Member

Choose a reason for hiding this comment

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

@moustaphacheikh here we can include steps to update in settings.py file when restoring legacy backup

ENABLE_BACKUPS=true docker compose up -d backup
```

This will configure automatic backups based on the `BACKUP_SCHEDULE`.
Copy link
Member

Choose a reason for hiding this comment

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

BACKUP_SCHEDULE is nowhere to be found

To ensure automatic backups are enabled, set `ENABLE_BACKUPS=true` (enabled by default):

```bash
ENABLE_BACKUPS=true docker compose up -d backup
Copy link
Member

Choose a reason for hiding this comment

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

If a user already deployed the tool (docker compose up -d) this container is already running so starting it again is not needed.

Also, what is the purpose of having backup container running if we have already scripts/backup_script.sh being managed by OS level crontab?

Copy link
Member

Choose a reason for hiding this comment

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

or are there like 3 ways to run backup?
a) manually by backup_script.sh
b) automatic - call backup_script.sh by cron
c) automatic - backup container running it from withing the container based on some schedule?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

ENABLE_BACKUPS: This was part of a work-in-progress documentation. It was initially used when we had cron jobs running inside the container, but it's no longer in use.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

we need the backup container to have the necessary libraries to do the db backups. the VM does not have the database.

#!/bin/bash

# Stop services that should not run during the backup
docker compose stop nginx flower worker beat web mq solr
Copy link
Member

Choose a reason for hiding this comment

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

do we need to stop all the services?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

to prevent any changes to the data while the backup is being created.

Copy link
Member

Choose a reason for hiding this comment

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

The backup was running fine so far with the service running. Not that a short downtime is an issue.
We can discuss this with @neoflex :)

@moustaphacheikh moustaphacheikh merged commit b9c0e79 into develop Oct 14, 2024
2 checks passed
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