Skip to content

Commit d400cce

Browse files
authored
Update Contributing to mention backup information (tl-its-umich-edu#1569)
* 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
1 parent b13d45e commit d400cce

File tree

2 files changed

+18
-2
lines changed

2 files changed

+18
-2
lines changed

docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ services:
99
env_file:
1010
- .env
1111
environment:
12-
- MYSQL_ROOT_HOST="0.0.0.0"
12+
- MYSQL_ROOT_HOST=%
1313
ports:
1414
- "5306:3306"
1515
volumes:

docs/CONTRIBUTING.md

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,8 +171,24 @@ docker exec -it student_dashboard_mysql mysql_upgrade \
171171
When prompted, specify the password for the root MySQL user.
172172
It should be found in the `MYSQL.ROOT_PASSWORD` property of `env.hjson`.
173173

174-
[Next: Contributors](../docs/CONTRIBUTORS.md)
174+
### Backing up the development database
175+
176+
To backup the development databaes with the default settings, use this command
177+
```sh
178+
docker exec student_dashboard_mysql mysqldump --socket=/tmp/mysql.sock -uroot -pstudent_dashboard_root_pw student_dashboard > student_dashboard.sql
179+
```
180+
181+
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).
182+
183+
```sh
184+
docker exec -i student_dashboard_mysql mysql -uroot -pstudent_dashboard_root_pw student_dashboard < student_dashboard.sql
185+
```
186+
187+
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.
175188
176189
### Dependency Upgrade
177190
178191
For Auto-upgrade django to future version, use the helpful library called [django-upgrade](https://github.com/adamchainz/django-upgrade )
192+
193+
[Next: Contributors](../docs/CONTRIBUTORS.md)
194+

0 commit comments

Comments
 (0)