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

Development: document --backupdb argument and load db data from dump #7761

Open
humitos opened this issue Dec 16, 2020 · 3 comments
Open

Development: document --backupdb argument and load db data from dump #7761

humitos opened this issue Dec 16, 2020 · 3 comments
Labels
Accepted Accepted issue on our roadmap Good First Issue Good for new contributors Needed: documentation Documentation is required Sprintable Small enough to sprint on

Comments

@humitos
Copy link
Member

humitos commented Dec 16, 2020

I've been using the --backupdb when running migrate (inv docker.manage --backupdb migrate) and today I needed the dump to go back to an old db state. I followed these steps:

inv docker.compose 'start database'
docker cp dump.sql community_database_1:/tmp/dump.sql
inv docker.shell --container database

$ dropdb -U docs_user docs_db
$ createdb -U docs_user docs_db
$ psql -U docs_user docs_db < /tmp/dump.sql

We should document this in https://docs.readthedocs.io/en/stable/development/standards.html

@humitos humitos added Needed: documentation Documentation is required Accepted Accepted issue on our roadmap labels Dec 16, 2020
@humitos humitos added Good First Issue Good for new contributors Sprintable Small enough to sprint on labels Dec 29, 2020
@humitos
Copy link
Member Author

humitos commented Mar 1, 2021

This could probably an invoke task called restoredb or simliar that executes all those commands automatically:

inv docker.restoredb --file dump_04-01-2021_15_46_55__d6c5948d38590d64e82088670c1e8a4ff430a41d.sql

@vitorsv1
Copy link

vitorsv1 commented Nov 6, 2021

Hi @humitos ! I'm working on it 😄

@vitorsv1
Copy link

Please ignore the second mentioned to this issue 😢

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Accepted Accepted issue on our roadmap Good First Issue Good for new contributors Needed: documentation Documentation is required Sprintable Small enough to sprint on
Projects
None yet
Development

No branches or pull requests

2 participants