From 80836f7c20c772f01ad0a086b87830e7384b86c0 Mon Sep 17 00:00:00 2001 From: "Code Hugger (Matthew Jones)" Date: Thu, 11 Apr 2024 15:16:15 -0400 Subject: [PATCH 1/6] Update Contributing to mention backup information --- docs/CONTRIBUTING.md | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/docs/CONTRIBUTING.md b/docs/CONTRIBUTING.md index f0390fe7..bf19290f 100644 --- a/docs/CONTRIBUTING.md +++ b/docs/CONTRIBUTING.md @@ -171,8 +171,23 @@ 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_dashboard2.sql +``` + +To restore this database +```sh +docker exec -i student_dashboard_mysql mysql -uroot -pstudent_dashboard_root_pw student_dashboard_new < 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) + From 04a70430f29625ade93a72f9e1a7209c1f91d9fb Mon Sep 17 00:00:00 2001 From: "Code Hugger (Matthew Jones)" Date: Thu, 11 Apr 2024 15:17:29 -0400 Subject: [PATCH 2/6] Changing MYSQL_ROOT_HOST to allow more connections. --- docker-compose.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker-compose.yml b/docker-compose.yml index 138935d8..0b7f7ddb 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -9,7 +9,7 @@ services: env_file: - .env environment: - - MYSQL_ROOT_HOST="0.0.0.0" + - MYSQL_ROOT_HOST=% ports: - "5306:3306" volumes: From 549d3de539b0cfb70535e321da630decd48e9789 Mon Sep 17 00:00:00 2001 From: "Code Hugger (Matthew Jones)" Date: Fri, 12 Apr 2024 10:28:48 -0400 Subject: [PATCH 3/6] Changed name of file --- docs/CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/CONTRIBUTING.md b/docs/CONTRIBUTING.md index bf19290f..fc4354f4 100644 --- a/docs/CONTRIBUTING.md +++ b/docs/CONTRIBUTING.md @@ -175,7 +175,7 @@ It should be found in the `MYSQL.ROOT_PASSWORD` property of `env.hjson`. 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_dashboard2.sql +docker exec student_dashboard_mysql mysqldump --socket=/tmp/mysql.sock -uroot -pstudent_dashboard_root_pw student_dashboard > student_dashboard.sql ``` To restore this database From 45a07c89028bb335d52cb23db1f3a6c43fa44d14 Mon Sep 17 00:00:00 2001 From: "Code Hugger (Matthew Jones)" Date: Fri, 12 Apr 2024 10:29:59 -0400 Subject: [PATCH 4/6] Adding some info about the new database --- docs/CONTRIBUTING.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/CONTRIBUTING.md b/docs/CONTRIBUTING.md index fc4354f4..628d96f5 100644 --- a/docs/CONTRIBUTING.md +++ b/docs/CONTRIBUTING.md @@ -178,7 +178,8 @@ To backup the development databaes with the default settings, use this command 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 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_new < student_dashboard.sql` ``` From 0b48db4d670cb5070a57f61909e6959fc4fe7a0b Mon Sep 17 00:00:00 2001 From: "Code Hugger (Matthew Jones)" Date: Fri, 26 Apr 2024 14:18:54 -0400 Subject: [PATCH 5/6] Update docs/CONTRIBUTING.md --- docs/CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/CONTRIBUTING.md b/docs/CONTRIBUTING.md index 628d96f5..3be400d3 100644 --- a/docs/CONTRIBUTING.md +++ b/docs/CONTRIBUTING.md @@ -181,7 +181,7 @@ docker exec student_dashboard_mysql mysqldump --socket=/tmp/mysql.sock -uroot -p 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_new < student_dashboard.sql` +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. From 69f9000b4de8da2adfb4dbfe05df43dde9c62fd8 Mon Sep 17 00:00:00 2001 From: "Code Hugger (Matthew Jones)" Date: Fri, 26 Apr 2024 14:20:24 -0400 Subject: [PATCH 6/6] Removing backtick in docker command --- docs/CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/CONTRIBUTING.md b/docs/CONTRIBUTING.md index 3be400d3..440cfef7 100644 --- a/docs/CONTRIBUTING.md +++ b/docs/CONTRIBUTING.md @@ -181,7 +181,7 @@ docker exec student_dashboard_mysql mysqldump --socket=/tmp/mysql.sock -uroot -p 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` +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.