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

Document how to restore from backup #2088

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

iaindillingham
Copy link
Member

In OpenCodelists, backups are JSON fixtures rather than SQL dumps. To restore from a backup, we must remember to remove the existing database and migrate, and then to load the data from the fixture.

In OpenCodelists, backups are JSON fixtures rather than SQL dumps. To
restore from a backup, we must remember to remove the existing database
and migrate, and *then* to load the data from the fixture.
Copy link
Contributor

@rebkwok rebkwok left a comment

Choose a reason for hiding this comment

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

This looks fine to me as documentation of how to restore a production backup in production. However, if it's used as a method of loading a version of the production db locally, as you did, it's probably worth some notes about how to also get the latest coding system databases (and a caveat that codelist versions use a specific coding system release, which corresponds to a database, and they won't display properly if they depend on a coding system database that you don't have locally)

@@ -48,6 +48,16 @@ A place to put scripts to be run via [runscript](https://django-extensions.readt

The production database and backups are located at `/var/lib/dokku/data/storage/opencodelists` on dokku3 (see also [deployment notes](DEPLOY.md)).

The backups are created with the dumpdata management command (`deploy/bin/backup.sh`).
Copy link
Contributor

Choose a reason for hiding this comment

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

Might be worth noting that these are backups of the core (default) db only, and not the coding system databases (which incidentally, are not backed up at all (but can theoretically be re-created from the coding system data files))

@iaindillingham
Copy link
Member Author

However, if it's used as a method of loading a version of the production db locally, as you did, it's probably worth some notes about how to also get the latest coding system databases (and a caveat that codelist versions use a specific coding system release, which corresponds to a database, and they won't display properly if they depend on a coding system database that you don't have locally)

Could I check my understanding, @rebkwok? I think this means that to restore the production database locally, I'd need to download all (or nearly all) the coding system databases. Is that correct? Would me not having done so explain #2091?

And if that is correct, then would that mean downloading every (or nearly every) *.sqlite3 file within /var/lib/dokku/data/storage/opencodelists/coding_systems/? (In other words, there aren't fixtures for these databases.)

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.

2 participants