Skip to content

Commit

Permalink
Update Contributing to mention backup information (#1569)
Browse files Browse the repository at this point in the history
* Update Contributing to mention backup information

* Changing MYSQL_ROOT_HOST to allow more connections.

* Changed name of file

* Adding some info about the new database

* Update docs/CONTRIBUTING.md

* Removing backtick in docker command
  • Loading branch information
jonespm committed May 6, 2024
1 parent b13d45e commit d400cce
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ services:
env_file:
- .env
environment:
- MYSQL_ROOT_HOST="0.0.0.0"
- MYSQL_ROOT_HOST=%
ports:
- "5306:3306"
volumes:
Expand Down
18 changes: 17 additions & 1 deletion docs/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -171,8 +171,24 @@ docker exec -it student_dashboard_mysql mysql_upgrade \
When prompted, specify the password for the root MySQL user.
It should be found in the `MYSQL.ROOT_PASSWORD` property of `env.hjson`.
[Next: Contributors](../docs/CONTRIBUTORS.md)
### Backing up the development database
To backup the development databaes with the default settings, use this command
```sh
docker exec student_dashboard_mysql mysqldump --socket=/tmp/mysql.sock -uroot -pstudent_dashboard_root_pw student_dashboard > student_dashboard.sql
```
To restore this database to a new database you had created as an admin called student_dashboard_new (CREATE database student_dashboard_new). You can also just restore it to the same database (student_dashboard).
```sh
docker exec -i student_dashboard_mysql mysql -uroot -pstudent_dashboard_root_pw student_dashboard < student_dashboard.sql
```
Note: It's possible you may need to recreate the database (delete the .data directory) if your value in docker-compose was `MYSQL_ROOT_HOST="0.0.0.0"` which makes it difficult to connect to MySQL.

### Dependency Upgrade

For Auto-upgrade django to future version, use the helpful library called [django-upgrade](https://github.com/adamchainz/django-upgrade )

[Next: Contributors](../docs/CONTRIBUTORS.md)

0 comments on commit d400cce

Please sign in to comment.